Re: [xsl] Fixed attribute problems on change from DTD to schema

Subject: Re: [xsl] Fixed attribute problems on change from DTD to schema
From: Kendall Shaw <kshaw@xxxxxxxxxxxxxxx>
Date: Mon, 28 Sep 2009 11:10:28 -0700
You can have this handled, without needing a schema aware xslt
processor. You can pass saxon a parsed document from java to have the
fixed attribute recognized, e.g.:

        SchemaFactory sf =
            SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setSchema(sf.newSchema(xsd));
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document doc = db.parse(xml);
        DOMSource ds = new DOMSource(doc);
        FileInputStream fis = new FileInputStream(xsl);
        StreamSource xs = new StreamSource(fis);
        StreamResult sr = new StreamResult(System.out);
        TransformerFactory tf = TransformerFactory.newInstance();
        Transformer trans = tf.newTransformer(xs);
        trans.transform(ds, sr);

Kendall

Current Thread