[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: < to < while preserving &
> <title>Me & You <i>together</i></title> > > I tried my best with character-maps to get from the above XML > the following HTML: > > <h3>Me & You <i>together</i></h3> > Character maps aren't going to help you. In general the way to get from a "<" character to an element node, or from an < entity reference to a "<" character, is by parsing. You need to take the content of your title element and put it through an XML parser, for example by using saxon:parse. But you can't do that because it will fail at the & character. You've got a dirty mess here, and like all data cleansing operations, the strategy depends on discovering the extent of the mess. If this title element is the sum total of your data, or the only part that's dirty, then edit it by hand. If it's part of a much larger mess, then we need a bigger picture as to what other horrors it contains. And of course the other part of data cleansing is to work out where the bad data came from and to stop it happening again. Michael Kay http://www.saxonica.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|