xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Dupras <bri...@centera.com>
Subject xslt with existing DOM nodes: HIERARCHY_REQUEST_ERR
Date Tue, 18 Jan 2000 16:59:24 GMT
Thanks for all the help I'm getting here with the apache xml/xsl

I'm trynig to get (xml Node) + (xsl Node) => (xml Node) working, but I keep
getting an error.  Thanks Scott for the XercesLiaison() fix - it got me half

The error I get now is:
 "org.apache.xerces.dom.DOMExceptionImpl: HIERARCHY_REQUEST_ERR"

I'm sending in two DOM nodes and want to receive a DOM node in return.
Following is a sample.


Code snippets:

private Element processElement(Element xmlelemTarget, 
                               Element xmlelemXSLT) 
                               throws SAXException 
	Document xmldocResult = new DocumentImpl();
	xsltProcessor.process(	new XSLTInputSource(xmlelemTarget), 
					new XSLTInputSource(xmlelemXSLT), 
					new XSLTResultTarget(xmldocResult)
	return xmldocResult.getDocumentElement();

domParser =

xsltProcessor = XSLTProcessorFactory.getProcessor(new

thexml = parser.parse(fname).getDocument().getDocumentElement();
thexsl = parser.parse(fname).getDocument().getDocumentElement();

NodeList nl = thexml.getElementsByTagName("component");
thexmlElement = (Element)nl.item(i);

//throws exception HIERARCHY_REQUEST_ERR:
Element result = processElement(thexmlElement, thexsl);

The xml Node (Element) looks like this:
  <resource rid='abdcedfghi127_nons'/>
  <type rid='abdcedfghi002_nons'/>

The xsl Node (Document Element) looks like this:
<?xml version="1.0"?>

	exclude-result-prefixes="pp xlink"
	<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />

Brian Dupras
Centera Information Systems, Inc.
phone	303.939.0200 x294
fax	303.939.0111
web	http://www.centera.com
email	briand@centera.com

View raw message