List Info

Thread: AW: Change error message in output for missing xinclude?




AW: Change error message in output for missing xinclude?
user name
2007-10-16 09:07:37
Phil, David and Markus!
Thanks a lot for your help. I have adjusted my mother file by adding the <xi:fallback> lines. Now the FO/PDF and HTML output looks good and supplies&nbsp;proper information.
I agree to Markus' opinion, that adjusting the scripting (which produces the referenced files) would be even more effective. But we have no influence over it.
Best wishes,
Martin
 


Von: Phil Borlin [mailto:rancidfishbreathgmail.com]
Gesendet: Montag, 15. Oktober 2007 19:10
An: Schramm, Martin
Betreff: Re: [docbook-apps] Change error message in output for missing xinclude?

This is very easy:

<;xi:include  ;href="intro.xml" xmlnsi="http://www.w3.org/2001/XInclude">
 ; <xi:fallback>
   ; <para>Currently there is no data available&lt;/para>;
 &nbsp;</xi:fallback>;
</xi:include>

Phil

On 10/15/07, Schramm, Martin <harmanbecker.com">MSchrammharmanbecker.com> wrote:
>; Dear list,
>
> I like to ask you for support in the following case:
>
> We have a DB "mother" document, which contains lots of xinclude
&gt; references to other files. Many of these referenced files are generated
> by scripts (containing tables with test results). These generated files
> are written in valid DocBook 4.5 .
>
> But sometimes there is no data to be published in those files. So there
> is no file and the specific folder is empty, where the xinclude
&gt; reference points to. In this case, when we publish the "mother" file as
> HTML or FO/PDF, there is naturally an error message in red letters
&gt; saying "<xi:include>&lt;/xi:include>".
&gt;
> How can I adjust my customization, so the HTML and FO/PDF output says
> e.g. "Currently there is no data available" in normal font style instead
&gt; of the original error message?
&gt;
> Thanks a lot for your support. I could not find any hint that helped me
> out of this problem.
&gt; Martin
>;
> We use: DocBook XML V4.5, XSTLProc, Antenna House V 4.2,
> Docbook-xsl-v1-69-1
&gt;
> *******************************************
> Harman Becker Automotive Systems GmbH
> Geschaeftsfuehrung:&nbsp; Dr. Peter Geiselhart  ;- &nbsp;Michael Mauser&nbsp; -&nbsp; Edwin Summers&nbsp; -&nbsp; Regis Baudot
>; Sitz der Gesellschaft: Karlsbad - Registergericht: Mannheim HRB 361395
>;
> *******************************************
> Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
> This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the contents in this e-mail is strictly forbidden.
> *******************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lists.oasis-open.org">docbook-apps-unsubscribelists.oasis-open.org
> For additional commands, e-mail: lists.oasis-open.org">docbook-apps-helplists.oasis-open.org
>
>


 
Re: Change error message in output for missing xinclude?
user name
2007-10-16 11:29:16
I'm not sure if anyone mentioned this, but you could customize the scripting to handle unresolved xincludes. You create a template that matches on xi:include to output your own message.&nbsp; The default message comes from this template that matches on any unrecognized element:
 
<xsl:template match="*"&gt;
  <xsl:message>
 &nbsp;  <xsl:text>Element </xsl:text>
&nbsp;   <xsl:value-of select="local-name(.)"/>
&nbsp; &nbsp; <xsl:text> in namespace '</xsl:text>
  ;  <xsl:value-of select="namespace-uri(.)"/>
 &nbsp;  <xsl:text>' encountered</xsl:text>
&nbsp;   <xsl:if test="parent:">
&nbsp; &nbsp; &nbsp; <xsl:text> in </xsl:text>
&nbsp;   ;  <xsl:value-of select="name(parent:)"/>
&nbsp; &nbsp; </xsl:if>
&nbsp; &nbsp; <xsl:text>, but no template matches.</xsl:text>
&nbsp; </xsl:message>
 
  <span style="color: red">
 &nbsp;  <xsl:text>&amp;lt;</xsl:text>
 &nbsp;  <xsl:value-of select="name(.)"/&gt;
 &nbsp;  <xsl:text>&amp;gt;</xsl:text>
 &nbsp;  <xsl:apply-templates/>
&nbsp;   <xsl:text>&amp;lt;/</xsl:text>;
 &nbsp;  <xsl:value-of select="name(.)"/>
 &nbsp;  <xsl:text>&amp;gt;</xsl:text>
  </span>
</xsl:template>
 
You could create a custom template like this:
 
<xsl:template match="xi:include">;
  <span class="EmptyInclude"&gt;
 &nbsp;  <xsl:text>Currently there is no Data available.</xsl:text>
&nbsp; </span>
</xsl:template>
&nbsp;
and perhaps add an xsl:message if you need it.
 
Bob Stayton
Sagehill Enterprises
DocBook Consulting
sagehill.net">bobssagehill.net
&nbsp;
 ;
----- Original Message -----
Sent: Tuesday, October 16, 2007 7:07 AM
Subject: AW: [docbook-apps] Change error message in output for missing xinclude?

Phil, David and Markus!
Thanks a lot for your help. I have adjusted my mother file by adding the <xi:fallback> lines. Now the FO/PDF and HTML output looks good and supplies&nbsp;proper information.
I agree to Markus' opinion, that adjusting the scripting (which produces the referenced files) would be even more effective. But we have no influence over it.
Best wishes,
Martin
 


Von: Phil Borlin [mailto:rancidfishbreathgmail.com]
Gesendet: Montag, 15. Oktober 2007 19:10
An: Schramm, Martin
Betreff: Re: [docbook-apps] Change error message in output for missing xinclude?

This is very easy:

<;xi:include  ;href="intro.xml" xmlnsi="http://www.w3.org/2001/XInclude">
 ; <xi:fallback>
   ; <para>Currently there is no data available&lt;/para>;
 &nbsp;</xi:fallback>;
</xi:include>

Phil

On 10/15/07, Schramm, Martin <harmanbecker.com">MSchrammharmanbecker.com> wrote:
>; Dear list,
>
> I like to ask you for support in the following case:
>
> We have a DB "mother" document, which contains lots of xinclude
&gt; references to other files. Many of these referenced files are generated
> by scripts (containing tables with test results). These generated files
> are written in valid DocBook 4.5 .
>
> But sometimes there is no data to be published in those files. So there
> is no file and the specific folder is empty, where the xinclude
&gt; reference points to. In this case, when we publish the "mother" file as
> HTML or FO/PDF, there is naturally an error message in red letters
&gt; saying "<xi:include>&lt;/xi:include>".
&gt;
> How can I adjust my customization, so the HTML and FO/PDF output says
> e.g. "Currently there is no data available" in normal font style instead
&gt; of the original error message?
&gt;
> Thanks a lot for your support. I could not find any hint that helped me
> out of this problem.
&gt; Martin
>;
> We use: DocBook XML V4.5, XSTLProc, Antenna House V 4.2,
> Docbook-xsl-v1-69-1
&gt;
> *******************************************
> Harman Becker Automotive Systems GmbH
> Geschaeftsfuehrung:&nbsp; Dr. Peter Geiselhart  ;- &nbsp;Michael Mauser&nbsp; -&nbsp; Edwin Summers&nbsp; -&nbsp; Regis Baudot
>; Sitz der Gesellschaft: Karlsbad - Registergericht: Mannheim HRB 361395
>;
> *******************************************
> Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
> This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the contents in this e-mail is strictly forbidden.
> *******************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lists.oasis-open.org">docbook-apps-unsubscribelists.oasis-open.org
> For additional commands, e-mail: lists.oasis-open.org">docbook-apps-helplists.oasis-open.org
>
>


 
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )