I'm using Xercesp 2.3.0-1 and am creating a DOMDocument with the following
code (similar to some of the sample code in the distribution):

    $impl = XML::Xerces::DOMImplementationRegistry::getDOMImplementation('LS');
    $dt   = $impl->createDocumentType($PrimaryTagName, '', $DTDURL);
    $doc  = $impl->createDocument('', $PrimaryTagName, $dt);

This has been working well, but when I added an ENTITY to my DTD that I wanted 
to
use in an attribute value created with code, I hit a snag.  The ENTITY is:

<!ENTITY ver "1.0">

and I wanted to be able to set an attribute as:

    $v = $doc->createElement("VersionElem");
    $v->setAttribute('version' , '&ver;');

What this produced when serialized was:

  <VersionElem version="&amp;ver;"/>

Not what I had hoped for.

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.'

The documentation for Xerces 2.6 reads the same way.

So, is there another way to insert ENTITY references in attribute values or am 
I stuck until XercesC is updated?

Thanks in advance,

Paul Harper
[EMAIL PROTECTED]

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

Reply via email to