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

RE: XSLT Replace for '<?xml:namespace>?

Subject: RE: XSLT Replace for '<?xml:namespace>?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 12 Sep 2007 09:32:08 +0100
RE:  XSLT Replace for '<?xml:namespace>?
> I'm stuck trying to eliminate an opening tag from an XML 
> file. Keep in mind: I cannot change the format of the source 
> file. It has HTML embedded in a CDATA section. I am running a 
> series of regex replaces and concats to clean up the source.

Presumably your "Source" below is this "HTML embedded in a CDATA section"?
It doesn't look much like HTML to me! 
> 
> But occasionally the source file has a "<?xml:namespace 
> prefix = lbxrt />" tag stuck in the HTML section that I need 
> to simply delete. I am trying to use a regex group replace to 
> do this, but regex always leaves "<?" no matter what I do. 
> It's as if it starts the match after the "?". 

You haven't escaped the ? in your regex. "<?" in a regex matches "<" or
nothing, it doesn't match "<?". You need "<\?".

Note that writing the ? as an XML character reference doesn't escape it.
Your &#63; is translated to a ? long before the regex parser sees it.

Michael Kay
http://www.saxonica.com/

Current Thread

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.