[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-p-dev
Subject:    Re: Question on using ENTITY's in attribute values when creating
From:       jason () openinformatics ! com (Jason E !  Stewart)
Date:       2004-12-01 9:29:01
Message-ID: 87k6s21ipe.fsf () openinformatics ! com
[Download RAW message or body]

"Paul Harper" <paulh@ncube.com> writes:

>     $v = $doc->createElement("VersionElem");
>     $v->setAttribute('version' , '&ver;');
>
> What this produced when serialized was:
>
>   <VersionElem version="&amp;ver;"/>
>
> Not what I had hoped for.

Ugh, yuck.

> I believe that I found the root of the problem in the documentation on the createDocumentType method:
>
>     'Entity declarations and notations are not made available. Entity reference
>     expansions and default attribute additions do not occur. It is expected 
>     that a future version of the DOM will provide a way for populating a 
>     DOMDocumentType.'

I think this is a red herring. I think the real culprit is the "expand
entitry references" flag. You can use the setExpandEntityReferences()
method on any parser (DOM or SAX) try setting it to false and see what
happens.

I must admit that I haven't ever tried this.

Cheers,
jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic