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

Re: Problem copying xhtml elements from xml source

Subject: Re: Problem copying xhtml elements from xml source
From: "M. David Peterson" <m.david@xxxxxxxxxx>
Date: Tue, 13 Jul 2004 09:35:07 -0600
problem copying
it even works with {name()}

name() references the fully qualified name of the element (e.g. "foo:bar") instead of {local-name()}

local-name() references just the local QName (e.g. foo:"bar")

(I guess because the xhtml namespace prefix in the stylesheet
is empty, anyway)

Although in this particular case the value of the name() property is the same as the local-name() property you will find that using the property value whose definition matches that of which you are trying to match will save you from frustration when, in future development, you use the name() property of an element that is bound to a namespace even though it may not seem like it to the naked eye.


Best regards,

<M:D/>



----- Original Message ----- From: "David Carlisle" <davidc@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, July 13, 2004 11:18 AM
Subject: Re: Problem copying xhtml elements from xml source




If you can control your input you would be better to fix your input so
it uses XHTML not elements in no-namespace that have the same local
names as XHTML elements, so use

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="test-copy-of.xsl"?>
<test-copy-of>
 <div xmlns="http://www.w3.org/1999/xhtml">
 <p style="color:red;">a paragraph in <b>red</b></p>
 <p><img src="wood102.jpg" width="149" height="177" alt="wood"/></p>
 </div>
</test-copy-of>

then your copy-of will work and everything will be fine.

Otherwise you need to change the namespace of every element, to XSLT
this is changing the name, like changing <a> to <b> so  you can do it,
but not with xsl:copy-of or xsl:copy.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.