Hi,
I try to make some Links from Java using Xerces but without
success.
My code is the following:
Document doc = XMLUtils.getDocumentBuilder().newDocument();
Element root = doc.createElement("Root");
doc.appendChild(root);
Element child_1 = doc.createElement("child_1");
root.appendChild(child_1);
Element el = doc.createElement("child_1_1");
child_1.appendChild(el);
Element child_2 = doc.createElement("child_2");
root.appendChild(child_2);
EntityReference ref = doc.createEntityReference("/child_1");
child_2.appendChild(ref);
XMLUtils.writeXML("XLinkTest.xml", doc);
In the above example I have the following error:
org.w3c.dom.DOMException: DOM002 Illegal character
at
org.apache.xerces.dom.CoreDocumentImpl.createEntityReference(CoreDocumentImpl.java:541)
at XLinkTest.main(XLinkTest.java:41)
I would like to have few kinds of links:
- in the same document - when I have repeated part I would like to
point to this part instead to make copy of the same part each
time;
- to the external XML document;
- to the external URLs
How to do this?
Best Regards,
Miroslav Nachev
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]