Hi,

 

I'm parsing a XSL template into a DOM tree using the DocumentBuilder and
after that I visit every Node in the tree using a NodeIterator.

I also visit every attribute Node and their values. The reason I go over the
tree is because I need to find all entity references and do something every
time I encounter one.

I can find all the entity references that are in the document itself, but it
seems as though the DocumentBuilder doesn't generate any nodes for entity
references contained in attributes.

For instance, if I have the following XML:

 

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<!DOCTYPE a

[

  <!ENTITY foo "foo">

  <!ENTITY bar "bar">

]>

<a attr="before&foo;after">

  &bar;

</a>

 

Parsing this document and then using a NodeIterator to visit the nodes gives
me these nodes:

 

Node a (element)

Node attr (attribute)

Node beforeafter (text)

Node bar (entity reference)

 

As you see, the entity reference &foo; in between the text before and after
in the attribute attr is nowhere to be found. I can't figure out where it
went.

I couldn't find any information about this on Google, that's why I'm turning
here before I report this as a bug.

Anyone know what is going on? Let me know if you need more information. Any
help is very much appreciated!

 

Thanks,

 

Paul van der Maas

Reply via email to