[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: RE: Re: Handling of special char

Subject: Re: RE: Re: Handling of special characters like © etc
From: Mike Brown <mike@xxxxxxxx>
Date: Thu, 3 May 2001 03:48:36 -0600 (MDT)
xml special char
Yogesh Dare wrote:
> Here I want to escape thr' < and > characters when it representd node
> i.e.<root> and suppose this appears as a part of text like this
> <mail-sender><mike@xxxxxxxx></mail-sender> then only I want to get rid of <
> and > characters.
> How to differentiate this before sending it to XSLTProcessor.

Your questions are vague, and only tangentially related to XSL, at best. 
You should be asking them in a more appropriate forum, like xml-dev or 

How are you making your XML? Are you using DOM objects? Are you putting 
Strings together?

If using DOM objects, you don't do any escaping. You put the data into the
nodes as-is. When it comes time to serialize the document in XML syntax,
the proper escaping will be done. People often write their own utilities
to recursively walk through the Document and emit the necessary element
and attribute tags and other markup, as well as the escaped character 
data. If feeding the DOM object directly to the XSL processor as input, 
there's no need to do this of course.

If you are making XML by pasting strings together (which is not a practice 
I recommend, but it can be done safely if you know what you are doing), 
then you'll need to do the escaping. It's a simple text substitution.
Well, simple in most languages. Java for some reason makes it incredibly 

If your problem is that you are receiving "XML" that is not really XML 
because it looks like <mail-sender><mike@xxxxxxxx></mail-sender>
then you must reject it because there is no way to differentiate between 
the markup and the other text! Tell whoever is sending you this malformed 
XML that the whole point of escaping the markup characters is so that 
there is no confusion about what is markup indicating element boundaries 
and entity references, and what is just character data.

   - Mike
mike j. brown, software engineer at  |  xml/xslt: http://skew.org/xml/
webb.net in denver, colorado, USA    |  personal: http://hyperreal.org/~mike/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.