cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arthur Bogaart" <a.boga...@hippo.nl>
Subject RE: xsl produces not well-formded xml for a XInclude command
Date Mon, 29 May 2006 14:37:08 GMT
Hi Kathi,

> <xi:include href="http://localhost/tamino/BSDB/Hessen?_XQUERY=update+insert+<brandgefahren>Keine</brandgefahren>+into+input()/BS_Konzept
> [gebaeude_id="1"]" />

I would actually be suprised when the above include works as intended, since you use a double-quote
character to escape the value of gebaude_id, while this will end the @href value prematurely.
Consider wrapping the value of gebaude_id in single-quotes?

regards,

Arthur Bogaart
-------------------------------------
Hippo

Oosteinde 11
1017 WT Amsterdam

Tel.   +31(0)20-5224466
Fax.  +31(0)20-5224467

a.bogaart@hippo.nl
www.hippo.nl
------------------------------------

> -----Original Message-----
> From: Antonio Gallardo [mailto:agallardo@agssa.net]
> Posted At: maandag 29 mei 2006 12:07
> Posted To: Cocoon User List
> Conversation: xsl produces not well-formded xml for a XInclude command
> Subject: Re: xsl produces not well-formded xml for a XInclude command
> 
> 
> kathi.mailbox@web.de escribió:
> >> -----Ursprüngliche Nachricht-----
> >> Von: users@cocoon.apache.org
> >> Gesendet: 29.05.06 11:02:27
> >> An: users@cocoon.apache.org
> >> Betreff: Re: xsl produces not well-formded xml for a 
> XInclude command
> >>     
> >
> >
> >   
> >> 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+inser
> t+<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_d
> er_Ausbreitung_von_Feuer_und_Rauch_(Brandausbreitung)_ 
> vorgebeugt_wird_und_bei_einem_Brand_die_Rettung_von_Menschen_u
> nd_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
> >>
> >>     
> >
> >
> > Hi Antonio,
> >
> > is it right, that I have to replace the character '<' with 
> '#x3C' and so on?
> > And why is the following xinclude command working:
> > <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+inser
> t+<brandgefahren>Keine</brandgefahren>+into+input()/BS_Konzept
> [gebaeude_id="1"]" />
> > </data>
> >   
> In the former href, the only weird char I see is ':'. Please try to 
> escape this.
> 
> Best Regards,
> 
> Antonio Gallardo.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

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


Mime
View raw message