[XML-SIG] Re: no parent?
matthias-gmane at mteege.de
Wed Oct 13 17:11:50 CEST 2004
Andrew Clover <and-xml at doxdesk.com> writes:
> > Is there a better way to replace the complete placeholder tag with
> > useful text?
> Well, at a guess:
> placeholders= document.getElementsByTagName('text:placeholder')
> for placeholder in list(placeholders):
> text= document.createTextNode('Hello!') # or whatever
> placeholder.parentNode.replaceChild(text, placeholder)
> (assuming you don't have any nested placeholder elements!)
This is exactly what I'm trying to do. Thanks. How do I get the
content in the placeholder tag? I need it to decide what text I put in
there but I only get the attributes with
'placeholder.attributes.items()'. Later I'll try to replace
placeholders in nested elements because I need to insert tables. Is
this a lot more work?
More information about the XML-SIG