  | |  | stylesheet doesn 't recognize elements | stylesheet doesn 't recognize elements 2003-09-22 - By Steve Carton
I have a stylesheet and a document that I'm processing from within a JAVA program.
Problem is, none of the elements in the document are recognized by the stylesheet. I get a result document that is essentially empty. Snippets follow. Any idea what is causing this?
Steve Carton
Stylesheet: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"><document><xsl:apply-templates select="*"/></document>< /xsl:template>
<xsl:template match="AGU-article"> ... never gets here!
Document: <!DOCTYPE AGU-article PUBLIC "-//AGU//DTD article American Geophysical Union DTD version 3.42//EN" "http://199.34.63.5/tractare/dtds/AGU-Article-3.42.dtd" [ <!ENTITY fig01 PUBLIC "-//AGU//NONSGML Media Files 2002jd002637-f01.tif//EN" "http://199.34.63.5/tractare/dtds/2002jd002637-f01.tif" NDATA tif> <!ENTITY fig02 PUBLIC "-//AGU//NONSGML Media Files 2002jd002637-f02.tif//EN" "http://199.34.63.5/tractare/dtds/2002jd002637-f02.tif" NDATA tif> <!ENTITY fig03 PUBLIC "-//AGU//NONSGML Media Files 2002jd002637-p03.tif//EN" "http://199.34.63.5/tractare/dtds/2002jd002637-p03.tif" NDATA tif> <!ENTITY fig04 PUBLIC "-//AGU//NONSGML Media Files 2002jd002637-f04.tif//EN" "http://199.34.63.5/tractare/dtds/2002jd002637-f04.tif" NDATA tif> ]> <AGU-article DOI="10.1029/2002JD002637" DTD-version="3.42" paper-number= "2002JD002637" paper-type="rga" xmlns="http://www.agu.org/XML"> <header> ...
This validates fine!
Java Code: TransformerFactory factory = TransformerFactory.newInstance(); Templates xsl = factory.newTemplates(new StreamSource(new File (XSLSpecPath+sKey+".xsl"))); Transformer transformer = xsl.newTransformer(); StreamSource ss = new StreamSource(new StringReader(xml)); transformer.transform(ss,new DOMResult(xmlColumns)); }
|
|
 |