You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ka...@web.de on 2006/05/29 10:52:08 UTC

xsl produces not well-formded xml for a XInclude command

Hi,

I have a problem with the xinclude transformer. I produce the xinclude command in the following stylesheet:

<xsl:template match="insert">
  <data>
    <xi:include>
      <xsl:attribute name="href">
        <xsl:value-of select="$server" />
        <xsl:text>?_XQUERY=update+insert</xsl:text>
        <xsl:if test="node_name">
          <xsl:text>+&lt;</xsl:text>
          <xsl:value-of select="node_name" />
          <xsl:if test="ID">
            <xsl:text>+ID="</xsl:text>
            <xsl:value-of select="ID" />
            <xsl:text>"</xsl:text>
         </xsl:if>
       <xsl:text>&gt;</xsl:text>
     </xsl:if>


     <xsl:for-each select="element_list/element">
       <xsl:text disable-output-escaping="yes">+&lt;</xsl:text>
       <xsl:value-of select="name" />
       <xsl:if test="ID">
         <xsl:text>+ID='</xsl:text>
         <xsl:value-of select="ID"/>
         <xsl:text>'</xsl:text>
       </xsl:if>
       <xsl:text>&gt;</xsl:text>
       <xsl:value-of select="value" />
       <xsl:text>&lt;/</xsl:text>
       <xsl:value-of select="name" />
       <xsl:text>&gt;</xsl:text>
     </xsl:for-each>

     <xsl:if test="node_name">
       <xsl:text>+&lt;/</xsl:text>
       <xsl:value-of select="node_name" />
       <xsl:text>&gt;</xsl:text>
     </xsl:if>
     <xsl:text>+into+input()/</xsl:text>
     <xsl:value-of select="path" />
   </xsl:attribute>
 </xi:include>
</data>
</xsl:template>


And this ist the xml that goes to the pipeline:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<data xmlns:ino="http://namespaces.softwareag.com/tamino/response2" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="http://localhost/tamino/BSDB/Hessen?_XQUERY=update+insert+<schutzziele>Allgemeine_Schutzziele_laut_Paragraph_14_MBO:_ Bauliche_Anlagen_sind_so_anzuordnen,_zu_errichten,_zu_aendern_und_instand_zu_halten,_dass_der_Entstehung_eines_Brandes_und_der_Ausbreitung_von_Feuer_und_Rauch_(Brandausbreitung)_ vorgebeugt_wird_und_bei_einem_Brand_die_Rettung_von_Menschen_und_Tieren_sowie_wirksame_Loescharbeiten_moeglich_sind. Besondere_Schutzziele:_ Keine </schutzziele>+into+input()/BS_Konzept[gebaeude_id="1"]" />

The output contains characters like '<' or '>' and not '&lt;' and '&gt;'. After this stylesheet there is the xinclude transformer, and it produces the following error message:

org.apache.cocoon.ProcessingException: Exception in ServerPagesGenerator.generate(): java.lang.RuntimeException: java.lang.RuntimeException:
org.xml.sax.SAXException: Exception occured during xinclude processing, and did not find a fallback element: null

How can I get a xml result with &lt; and &gt; in it? And is this the reason for the above error? 

Kathi

p.s. I've posted this problem some time ago, but I get not many answers. But there is some more information on this problem: 
http://www.mail-archive.com/users@cocoon.apache.org/msg33785.html

______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: xsl produces not well-formded xml for a XInclude command

Posted by Antonio Gallardo <ag...@agssa.net>.
kathi.mailbox@web.de escribió:
> Hi,
>
> I have a problem with the xinclude transformer. I produce the xinclude command in the following stylesheet:
>
> <xsl:template match="insert">
>   <data>
>     <xi:include>
>       <xsl:attribute name="href">
>         <xsl:value-of select="$server" />
>         <xsl:text>?_XQUERY=update+insert</xsl:text>
>         <xsl:if test="node_name">
>           <xsl:text>+&lt;</xsl:text>
>           <xsl:value-of select="node_name" />
>           <xsl:if test="ID">
>             <xsl:text>+ID="</xsl:text>
>             <xsl:value-of select="ID" />
>             <xsl:text>"</xsl:text>
>          </xsl:if>
>        <xsl:text>&gt;</xsl:text>
>      </xsl:if>
>
>
>      <xsl:for-each select="element_list/element">
>        <xsl:text disable-output-escaping="yes">+&lt;</xsl:text>
>        <xsl:value-of select="name" />
>        <xsl:if test="ID">
>          <xsl:text>+ID='</xsl:text>
>          <xsl:value-of select="ID"/>
>          <xsl:text>'</xsl:text>
>        </xsl:if>
>        <xsl:text>&gt;</xsl:text>
>        <xsl:value-of select="value" />
>        <xsl:text>&lt;/</xsl:text>
>        <xsl:value-of select="name" />
>        <xsl:text>&gt;</xsl:text>
>      </xsl:for-each>
>
>      <xsl:if test="node_name">
>        <xsl:text>+&lt;/</xsl:text>
>        <xsl:value-of select="node_name" />
>        <xsl:text>&gt;</xsl:text>
>      </xsl:if>
>      <xsl:text>+into+input()/</xsl:text>
>      <xsl:value-of select="path" />
>    </xsl:attribute>
>  </xi:include>
> </data>
> </xsl:template>
>
>
> And this ist the xml that goes to the pipeline:
>
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <data xmlns:ino="http://namespaces.softwareag.com/tamino/response2" xmlns:xi="http://www.w3.org/2001/XInclude">
> <xi:include href="http://localhost/tamino/BSDB/Hessen?_XQUERY=update+insert+<schutzziele>Allgemeine_Schutzziele_laut_Paragraph_14_MBO:_ Bauliche_Anlagen_sind_so_anzuordnen,_zu_errichten,_zu_aendern_und_instand_zu_halten,_dass_der_Entstehung_eines_Brandes_und_der_Ausbreitung_von_Feuer_und_Rauch_(Brandausbreitung)_ vorgebeugt_wird_und_bei_einem_Brand_die_Rettung_von_Menschen_und_Tieren_sowie_wirksame_Loescharbeiten_moeglich_sind. Besondere_Schutzziele:_ Keine </schutzziele>+into+input()/BS_Konzept[gebaeude_id="1"]" />
>
> The output contains characters like '<' or '>' and not '&lt;' and '&gt;'. After this stylesheet there is the xinclude transformer, and it produces the following error message:
>
> org.apache.cocoon.ProcessingException: Exception in ServerPagesGenerator.generate(): java.lang.RuntimeException: java.lang.RuntimeException:
> org.xml.sax.SAXException: Exception occured during xinclude processing, and did not find a fallback element: null
>
> How can I get a xml result with &lt; and &gt; in it? And is this the reason for the above error? 
>   
Hi Kathi,

Seems like your xslt is not escaping as expected [1].

Best Regards,

Antonio Gallardo

[1] http://www.w3.org/TR/xinclude/#IRIs


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: xsl produces not well-formded xml for a XInclude command

Posted by Jason Johnston <co...@lojjic.net>.
kathi.mailbox@web.de wrote:
> 
> <?xml version="1.0" encoding="ISO-8859-1" ?> <data
> xmlns:ino="http://namespaces.softwareag.com/tamino/response2"
> xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include
> href="http://localhost/tamino/BSDB/Hessen?_XQUERY=update+insert+<schutzziele>Allgemeine_Schutzziele_laut_Paragraph_14_MBO:_
> Bauliche_Anlagen_sind_so_anzuordnen,_zu_errichten,_zu_aendern_und_instand_zu_halten,_dass_der_Entstehung_eines_Brandes_und_der_Ausbreitung_von_Feuer_und_Rauch_(Brandausbreitung)_
> vorgebeugt_wird_und_bei_einem_Brand_die_Rettung_von_Menschen_und_Tieren_sowie_wirksame_Loescharbeiten_moeglich_sind.
> Besondere_Schutzziele:_ Keine
> </schutzziele>+into+input()/BS_Konzept[gebaeude_id="1"]" />
> 
> The output contains characters like '<' or '>' and not '&lt;' and
> '&gt;'. After this stylesheet there is the xinclude transformer, and
> it produces the following error message:

I just thought of something... are you copying this XML out of a 
pretty-formatted browser view of the XML rather than the actual XML 
source?  Firefox at least (haven't checked IE) displays the &quot; &lt; 
&gt; entity references as " < > within attributes in its pretty-print 
view, so that would explain their presence in your pasted content. 
Viewing the raw source should show the actual entity references.

--Jason

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org