Jan Uhlir wrote:
Alias: How to force a default namespace to use prefix

Sorry if I missed something important, I'm quite new to namespace problematics.
But I'm deadlocked at the last point to solve of the whole transformation 
process.

Everything works nice, except that XHTML namespace is set as default namespace, so no prefixes, preferably 'html' prefix, is not included in element names when serialized back to string.

I'm getting:
<html xmlns="http://www.w3.org/1999/xhtml";>
<body> some <b> bold </b> text </body>
</html>

But I need:
<html xmlns:html="http://www.w3.org/1999/xhtml";>
<html:body> some <html:b> bold </html:b> text </html:body>
</html>

Why? Because in reality I pick peaces of html - often corrupt! - from database transforming them to valid xhtml and finally assemble them into another, bigger XML, with multiple namespaces. Indeed, I build RSS/Atom feed.
[...]

Hi,

I don't understand your problem. Both versions are equivalent. Even if you don't compose your final RSS/Atom document using DOM or similar, but pasting the generated XML string into another one (which you shouldn't do IMHO), it should be correct. In the first version, the default namespace is set to the XHTML namespace. It therefore also applies to the <body> and <b> elements.

Regards,

Klaus

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to