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

Re: Transform xhtml to xhtml, convert one tag to ano

Subject: Re: Transform xhtml to xhtml, convert one tag to another, while preserving rest of file
From: "Peter O." <xolox@xxxxxxx>
Date: Tue, 08 Feb 2005 17:57:38 +0100
transform xhtml
Lots of questions about namespaces and behavior related to it that I don't understand, but if you don't feel like explaining the namespace thing and think I should just look it up: ok, you're right. I will. :-)

Thanks to both Wendell Piez & Joris Gillis for pointing out that elements inherit parent elements' namespaces. (is this the correct way of defining this behavior?)

Because you both mentioned namespaces, I looked through my source and I discovered that I hadn't even included the XHTML namespace in my (X)HTML documents root tag (<html>)... Quickly added it, to be sure I was correct and on line with both your expectations :-).

Then I thought, 'Hey, wait a sec, if there was no namespace before, the template should have matched...' Right? The XHTML documents did include the doctype definition, but for as far as I know this doesn't mean that all elements are in the XHTML namespace, or is this infact the case? Hehe, nevermind, getting off-topic here, guess I should just read about namespaces some more.

Anyways, added namespace, adjusted template, as you both suggested, but things did not work out ok. :(

The document stays the same (well, not exactly: read on), except of course the added namespace in the source xhtml documents root (<html>) appears.

But there's something else. Almost all of the elements in my page now appear with the empty attribute xmlns, like:

<p xmlns=""></p>

for example. Why is this? Doesn't seem logical at all. But the strangest thing -to me anyway- is that some elements do, and some elements don't get the attribute. Every <p> element does, but for example <em> does not. I got so far (with help of the XHTML Recommendation) that it seems block elements (h1-h6, div, etc) do, and inline (em, strong, etc) don't include this empty attribute, and empty elements (hr) don't get it either. Why does Xalan do this? Never seen/heard about this behavior before.

Ok, sorry about all the namespace stuff, back to the original subject: it still doesn't work. The XHTML namespace is now present in both the XHTML source files and the XSL file that processes them. I've also changed the template to match "xhtml:reference". Anything I could have missed?

Maybe I should post the files on the web so someone (with a lot of time on his/her hands and a very helpful attitude) could take a look at them.

Sorry for the long text, I'm not that good at summarising. And thanks a lot for your attention and help so far! I really appreciate it! Don't think I could have solved this on my own. Seems I'm still a total newbie in the land of XSL :-).

- Peter Odding

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.