public static Object getNodeForRef(org.w3c.dom.Node nodeRef){
System.out.println("==== getNodeForRef() for " + nodeRef.getTextContent() + " called ====");
return XMLConverter.getInstance().getNodeForRef(nodeRef);
}
If i call nodeRef.getTextContent(), i get an exception:
Transform.xsl (253, 60): java.lang.RuntimeException: java.lang.AbstractMethodError: org.apache.xml.dtm.ref.DTMNodeProxy.getTextContent()Ljava/lang/String;
In my SS-environment im using the xalan-transformer. When i make the transformation in my own Java-application (with xalan-j_2_7_0) it works.
Subject:Processing Nodes in Java extensions Author:Ivan Pedruzzi Date:25 Jan 2006 11:53 AM
Hi Stephan,
XalanJ 2.5.2 relies on XercesJ 2.5 XML parser that doesn't support DOM level 3 features like getTextContent. But you can still achieve the same result with any XML parser with few changes
Change your Java function like the following
public Object getNodeForRef(org.w3c.dom.Node nodeRef, String value){
System.out.println("==== getNodeForRef() for " + value + " called ====");
return XMLConverter.getInstance().getNodeForRef(nodeRef);return nodeRef;
}
Subject:Processing Nodes in Java extensions Author:Stephan Kübler Date:26 Jan 2006 03:39 AM Originally Posted: 26 Jan 2006 03:36 AM
Hi Ivan!!
thanks for the quick reply! But i want not just call getTextContent() for my Node in my XMLConverter class, i want to call other functions, too. So my question is: is there a possibility to use the new Xalan 2.7.0 -version with the Stylusstudio, or, if not, can i get a documentation about the old DOM-API, so that i know, which functions of the org.w3c.dom.Node interface i can call with the older Xalan 2.5.0?!?
Kind regards
and thank you again!
Subject:Processing Nodes in Java extensions Author:Stephan Kübler Date:26 Jan 2006 11:13 AM
Ok,
now my problem is that i have to read the entities of the ownerdocument of the Node-object. With Xalan 2.7.0 i can call getOwnerDocument().getDocumentType().getEntities()
Is there any possiblity to get this also with DOM2?? Otherwise it's not possible to debug my xsl-files :-(
Subject:Processing Nodes in Java extensions Author:Stephan Kübler Date:27 Jan 2006 03:44 AM
yes, i believe that it must look like that!!
What i want to do inside my extension function is to get referenced nodes, that are inside another XML-document and transform these nodes also in my XSL-file. To look up for the referenced document i have to look inside the entity block of my XML-document where i find a system-id. With this system-id i have to look in a catalog-file(not a XML-catalog, but a SGML-catalog) for the path to the referenced file(the system-id could also be overwritten by a new system-id in another catalog-file). So i use the class CatalogResolver.
If i got the referenced document i can search the node via ID (the referenced node may also have references to another file).
So i decided to write an extension function because i found no way to get the system-id in the entity-block and to get the correct document via the catalog-file. The entity looks like this:
<!ENTITY nodereference PUBLIC "system-id" "./reference.xml" NDATA SGML>
Is this possible with XSLT? Maybe. I'm not a XSLT-guru :-)
So, i hope, you can understand this. It was quite long.
Subject:Processing Nodes in Java extensions Author:Stephan Kübler Date:27 Jan 2006 10:38 AM
No, this won't work, because then i get ./reference.xml from the entity. I have to get the system-id and then look inside the catalog-files. So it's more complicated. Do you know if a new Stylus version is planned with the XalanJ 2.7.0??