This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] Errorhandling


Since you are using XInclude, you might try to figure out how to get the
processor to add an xml:base attribute to each included file.  Then your
message template could look for an ancestor element with xml:base to get the
filename.

The xml:base attributes are added by the XInclude processor when included
files are in different directories.  I don't know what your setup is, but
maybe you already are getting them.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Kai Hagemeister" <kh@planoweb.de>
To: "Bob Stayton" <bobs@sagehill.net>
Cc: <docbook-apps@lists.oasis-open.org>
Sent: Tuesday, December 21, 2004 5:49 AM
Subject: Re: [docbook-apps] Errorhandling


> Hello Bob,
>
> thanks for your reply.
>
> > The command line filename is not provided to the stylesheet by the XSLT
> > processor.  I think you will have to pass the filename as a parameter to
the
> > stylesheet at runtime:
> >
> > xsltproc --stringparam filename "myfile.xml" etc.
>
> This seems to be a solution if there is only one xml-file. My case is
> somewhat different. I have a parent xml-file wich includes the other
> xml-files. In other words, every chapter is a xml-file in its own. Thats
> the reason why I'm looking for a possibility to find out the file in
> which a failure occures.
>
> Once again, thank you for your indefatigable help.
> Kai
>
>
>
> > Then your error message could include <xsl:value-of
select="$filename"/>.
> >
> > Bob Stayton
> > Sagehill Enterprises
> > DocBook Consulting
> > bobs@sagehill.net
> >
> >
> > ----- Original Message ----- 
> > From: "Kai Hagemeister" <kh@planoweb.de>
> > To: <docbook-apps@lists.oasis-open.org>
> > Sent: Friday, December 17, 2004 8:16 AM
> > Subject: [docbook-apps] Errorhandling
> >
> >
> >
> >>Hello,
> >>
> >>I'm using xsltproc and terminate the process on error.
> >>What I'm looking for is a way to return (inside of xsl:message) the
> >>xml-file in which the error occured.
> >>At this time I can return the line-number but this is not of any help if
> >>no hint is given in which file one should look for the error.
> >>
> >><xsl:message terminate="yes">
> >> <!-- File ??? -->
> >> <xsl:text>Line-number:</xsl:text>
> >> <xsl:value-of select="saxon:line-number()"/>
> >> <xsl:text>Error: no ID for constraint linkend: </xsl:text>
> >> <xsl:value-of select="$linkend"/>
> >> <xsl:text>.</xsl:text>
> >></xsl:message>
> >>
> >>I hope that someone can assist.
> >>Kai
> >>
> >>
> >
> >
> >
> >
>
>
>



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]