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

RE: Fixing <b>

Subject: RE: Fixing <b>
From: Lea Allison <Lea.Allison@xxxxxxxxxxxxxx>
Date: Wed, 27 Mar 2002 07:13:00 +0100
xml gt lt
Very helpful Mike.


-----Original Message-----
From: Mike Brown [mailto:mike@xxxxxxxx]
Sent: Wednesday 27 March 2002 04:50
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Fixing &amp;lt;b&amp;gt;


tammy@xxxxxxxx wrote:
> Hi all!
> 
> I've got data that looks like:
> 
> <body>
>   <p>&amp;lt;b&amp;gt;Some Text&amp;lt;/b&amp;gt;&amp;lt;p&amp;gt;
>   &amp;lt;i&amp;gt;Some More Text&amp;lt;/i&amp;gt;&amp;lt;p&amp;gt;
>   </p>
> </body>
> 
> And I need it to convert it to this:
> 
> <body>
>   <p><b>Some Text</b><p/>
>   <i>Some More Text</i><p/>
>   </p>
> </body>
> 
> I appreciate your help on this.
> 
> Tammy Kohl

1. This is a FAQ. When people ask this question, it indicates they do not
understand some fundamental concepts of XML, XSLT and the XPath/XSLT data
model.

2. There is a way to do exactly what you want, but the solution that some
would recommend (disable-output-escaping) is not guaranteed to be portable,
and is bad form because...

3. You're abusing XML and XPath, pretending an innocuous blob of character
data is actually structured markup that needs to be parsed.

Where is the escaped data coming from? Why was it escaped in the first
place?
Because it's not well-formed XML? It's generally considered "bad" to embed
HTML in XML as character data (which essentially obscures the fact that it
is
markup), and then try to extract it and emit it as actual HTML markup, using
XPath/XSLT. XSLT is about tree walking, tree building and automatic tree
serialization... not string parsing and string concatenation.

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

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

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


Current Thread
  • Fixing &amp;lt;b&amp;gt;
    • tammy - Tue, 26 Mar 2002 21:51:27 -0500 (EST)
      • <Possible follow-ups>
      • Lea Allison - Wed, 27 Mar 2002 01:12:29 -0500 (EST) <=
      • tammy - Wed, 27 Mar 2002 06:44:48 -0500 (EST)
        • naha - Wed, 27 Mar 2002 09:08:55 -0500 (EST)
        • Mike Brown - Wed, 27 Mar 2002 21:56:59 -0500 (EST)

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.