我尝试了很多组合来解决这个异常但是徒劳无功: 这一行抛出异常:
aXsl = processor.newXSLStylesheet(xmlDocument);
oracle.xml.xslt.XSLException: XML-22009: (Error) Attribute '{http://www.w3.org/1999/XSL/Transform}:version' not found in 'Address'.
at oracle.xml.xslt.XSLStylesheet.flushErrors(XSLStylesheet.java:1845)
at oracle.xml.xslt.XSLStylesheet.endContent(XSLStylesheet.java:394)
at oracle.xml.xslt.XSLBuilder.endDocument(XSLBuilder.java:304)
at oracle.xml.parser.v2.XMLDocument.reportSAXEvents(XMLDocument.java:1541)
at oracle.xml.xslt.XSLProcessor.newXSLStylesheet(XSLProcessor.java:628)
at oracle.xml.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:355)
at com.ei.commons.transformers.infoarchitect.IAXsltHandler.buildAddressXslt(IAXsltHandler.java:124)
at com.ei.commons.transformers.infoarchitect.TestFieldsAtRuntime.main(TestFieldsAtRuntime.java:818)
这里是xml示例,我的目标是获取XSLT:
<?xml version="1.0" encoding="UTF-16"?>
<Address>
<physicalAddress>
<streetNumber>2</streetNumber>
<streetName>Queen St</streetName>
<buildingName>MF Shopping Centre</buildingName>
</physicalAddress>
</Address>