Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > How to escape > in XML/XSL

Reply
Thread Tools

How to escape > in XML/XSL

 
 
Niko
Guest
Posts: n/a
 
      09-03-2003
I am trying to pass a piece of XMLthat has escaped characters e.g >
into a new piece of XML. However when I pass it I don't want these
characters escaped and want them to appear in the XML.

Any ideas on how to do this.

TIA
 
Reply With Quote
 
 
 
 
Mike Brown
Guest
Posts: n/a
 
      09-04-2003
> I am trying to pass a piece of XMLthat has escaped characters e.g >
> into a new piece of XML. However when I pass it I don't want these
> characters escaped and want them to appear in the XML.
>
> Any ideas on how to do this.


FAQ.

You're essentially asking for a way to re-parse something that was
designated character data in your XML as if it were actually elements and
other markup. If you want it to be treated as markup, don't put it in your
original XML as character data. Fix the problem at it's source.

If you cannot fix the XML, then check your XSLT processor's docs for an
extension function that can parse an arbitrary string and return a node-set
or result tree fragment. If there isn't one, then write your own. You'll
probably need to wrap the string in a dummy element to ensure it's a
well-formed document entity before you send it to the parser.

In a controlled environment you may be able to rely on the kludgy
disable-output-escaping="yes" on xsl:value-of or xsl:text. It's not
guaranteed to work if the XSLT processor is not in direct control of the
serializer, if any (e.g. the processor may actually output a DOM object,
thus rendering d-o-e ineffective... Netscape/Mozilla comes to mind).



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read strings cantaining escape character from a file and useit as escape sequences? slomo Python 5 12-02-2007 11:39 AM
vhdl textio and escape sequences Olaf Petzold VHDL 1 11-28-2005 06:22 PM
escape sequence branigan Cisco 4 04-15-2005 02:14 PM
trying out escape characters Griff Perl 6 08-20-2004 08:20 PM
escape a whole regex Tassos Perl 2 12-12-2003 06:36 PM



Advertisments