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

Re: Rebuild an element without copying defaulted attr

Subject: Re: Rebuild an element without copying defaulted attributes?
From: "Dan Vint dvint@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 12 Aug 2014 23:30:22 -0000
Re:  Rebuild an element without copying defaulted  attr
Yeah I figured that would be the answer but was hoping. If I remove the DOCTYPE declaration before processing that gets them all out of the way and for my conversion I don't need those values. The stylesheet will add the DOCTYPE back on the files and I will load them back into the CMS.

Thanks

..dan


At 02:14 PM 8/12/2014, Abel Braaksma (Exselt) abel@xxxxxxxxxx wrote:


> I'm looking for a generalized solution so I didn't have to search
> the DTD for all defaulted vaules. I just happened to catch
> xml:space as I had a different problem that I fixed.

Remember that in XML there is no difference between the defaulted value of the attribute set through the DTD and the same value set explicitly. Also, unless you copy the same DTD to the output, you would lose this default value if you remove it as in the examples shown, which is why the attribute with default value is considered to be present on the <pre> and other elements on which it is defined.

Removing it the way you did, and similar for any other defaults, may alter the way the XML is rendered or interpreted, unless you recreate the same defaults through a DTD. If that is intentional (i.e., if you indeed want to remove any attribute that has a default value), straight XSLT may not be the ideal solution, because this DTD information is not annotated / retained on the nodes, either during processing or in the result.

For automated processing, XML with the explicit or implicit default attribute is the same.

Cheers,

Abel Braaksma
Exselt streaming XSLT 3.0 processor
http://exselt.net





--------------------------------------------------------------------------- Danny Vint

Panoramic Photography
http://www.dvint.com

voice: 619-647-5780

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.