Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: one attribute has a string in xml format

From: "Oleg Tkachenko [MVP]" <oleg@--!----!---------------.--->
To: NULL
Date: 6/1/2005 1:13:00 PM
juergen wrote:
> My xml file look like:
> 
> <Sequences>
> <Comment text="This is a test comment!" id="<CallingSeq name="Sequence 01" 

This isn't XML. In XML attributes cannot contain character <, it must be 
escaped as &lt;

> The attribute "id" is a xml string, from which I need a few infos 
> "descriptions" in my html document. The document should be created by xslt an 
> I can't used the string functions from xslt (more than two "desc" in the 
> string could be founded). 
> Is it possible to translate the attribute string in a node structure?

It's really hard to create such weird document with XSLT. Even 
disable-output-escaping won't help creating < charcter in attribute.
The only solution is to emulate XML:

<xsl:text disable-output-escaping="yes">&lt;Comment text="This is a test 
comment!" id="</xsl:text>
             <CallingSeq name="Sequence 01"
             path="TestProject-01/Sequence Folder 01"
             guid="d49f2b33-ab40-486a-898a-4fc8a179bb75" desc="test seq 
01" label="SeqV1"
             version="1" /><Step name="Comment step 01" 
path="TestProject-01/Step Folder
01" guid="0ec07b91-8c03-47d0-8b2e-b9c0c4e9ef20" desc="comment 01"
label="StepV1" version="1" />
             <xsl:text>" /></xsl:text>

And beware again - the result isn't XML.

-- 
Oleg Tkachenko [XML MVP, MCAD]
http://blog.tkachenko.com


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent