For me, these looks like parser and/or XSL issues and not JAXP issues. JAXP is a convenience framework that helps you choose a parser( from a collection of available ones ) at the application level. What happens after you start parsing is beyond the control of JAXP. Coming back to your original question, the DTD only constraints what is valid( and what is not ) in your XML document. I don't think DTD has any impact on transfomrations and output generation. I may be wrong and I'd love to be corrected
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
posted 18 years ago
Dear Ajith, You haven't understood my question. I have no problems with XSL, XSLT or any other XML related standards. I have problems with the way the JAXP implements transformations. I have used JAXP for quite some time, but they upgraded it recently. The latest release of JAXP, i.e. 1.1 in addition to upgrading its SAX API, has added new transformation packages. As you might be aware that the transformation api provides two interfaces Source and Result that abstract the concept of the Source and Result tree in XSLT, and more that that they provide specialized implementations of these for SAX, DOM and Stream sources. I am using a SAX Source, I have made an XSL stylesheet which works fine with IE-5 and does all I want it to, but when I use the Transformer.transform() method to convert the same source it creates problems. My question is "How do i link my DTD to the SAX Source and to the Transformer so that it picks up the values of the attributes that are defaulted in the DTD and thus are not actually part of the document being transformed?" I hope I am explicit this time. By the way,I am building a small appication for my personal use, actually for storing my class notes. Aldrin John.
Hey, I think DTD does have an effect on the transformation process. Where would the transformer get the values of the attributes that are defaulted or #FIXED without refering the DTD. Let's talk about my problem precisely. I have a date element, whose 'year' attribute is #FIXED in the DTD as 2001. Now every time I make a document, I don't give the value for the 'year' attribute, and I expect that the transformer would take it from the DTD, but it doesn't. I had worded my problem in pretty precise terms but it seems you didn't get it. I am really sorry, if I am confusing you guys with my silly questions. Let me repeat it (for the last time ). " I 'feel' the javax.xml.transform.Transformer is a non-validating processor, which is why it does not take the DTD into account when it transforms the document. What I want to know is how do I make it a validating one." By the way there are some disparities in the namespace implementation in JAXP, it does not do exactly what the specification requires it to. Do you have any ideas in this matter. Actually, i have problems with the 'uniqueness of attributes'. Do you know about some really good JAXP reference.
[This message has been edited by Aldrin Dsouza (edited June 17, 2001).]
I just got this email from Sun's XML announcements mailing list. Maybe the new tutorial will help you. (Incidently, I think the May 18th date is a misprint & they mean June 18, tomorrow) "An updated version of the JAXP tutorial will be available Monday morning, May 18th. This message describes the additions: 1. The description of using XPath expressions to select sets of XML nodes is now complete. You can find it at http://java.sun.com/xml/jaxp-1.1/docs/tutorial/xslt/1_intro.html 2. The section that describes creating an XSLT stylesheet and using it to transform XML data is not complete, but now has a detailed-enough set of notes that a sufficiently- determined individual could use it to get the job done. That page is at http://java.sun.com/xml/jaxp-1.1/docs/tutorial/xslt/4_transform.html Coming up: a) Work through the XSLT transformation example and write it up. (That will finish up the content of the JAXP tutorial.) b) Make a PDF version of the tutorial available. "
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library