Re: How do I access the original name for XML elements, including the original namespace prefix.

Geoff Shuetrim <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Organization Galexy
Message-ID <1224721024.6658.37.camel@dell>
On Wed, 2008-10-22 at 13:19 +0200, Daniel Dekany wrote:
[snip]
> I
> still think that the easiest would be if you configure the document
> builder factory to namespace unaware. Of course, if you also have to
> use the same DOM for other purposes than reproducing an XML source
> code, then that's not an option.
[snip]

You are right that this is the sticking point.  The DOM is more normally
used for things where namespace awareness is critical.  I can parse the
XML document both ways but that is not particularly elegant so I have
been casting around for other options.

I am not sure I quite get Jonathan's suggestion yet.  Does it involve
tinkering with the Freemarker freemarker.ext.dom.ElementModel and
freemarker.ext.dom.NodeOutputter classes so that I can use
@@original_prefix as a key for element nodes?  That looks like it would
work but it is a pity to be customising Freemarker directly.

As a side question, where can I read about the convention regarding
variables with names that start with @ and @@?  I have not come across
anything in the reference pages on the website.

Regards

Geoff Shuetrim


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.