|
Re: output html as lower case?: msg#00035java.enhydra.xmlc
Another update. I'm working with some of the Jaxen developers who have come up with a DocumentNavigator for the HTML DOM which allows for defining the case that you prefer the XPath to be evaluated. It does this by forcing node names to the case you choose. For instance, the following will work on the HTML DOM... XPath query = new HTMLXPath("/html/head/title"); ...where the following will not... XPath query = new DOMXPath("/html/head/title"); The reason is that HTMLXPath, by default, forces element names to lower case even though they are stored in upper case in the HTML DOM. One can also override the default by using another constructor... XPath query = new HTMLXPath("/HTML/HEAD/TITLE", false); ...which is entirely equivalent to.... XPath query = new DOMXPath("/HTML/HEAD/TITLE"); The boolean constructor of HTMLXPath allows you specify "true" (the default) for lower case elements and "false" for upper case elements. With HTMLXPath, you can now use the same XPath _expression_ on both HTML and XHTML documents (or XML documents, for that matter). XHTML and, hence, XML documents won't have the case conversion done to them to avoid breaking the XHTML spec where all elements are required to be lower case. This should soon be in the Jaxen CVS. I plan to use a build of Jaxen supporting HTMLXPath for the XPath demo in XMLC-2.2. Jake At 12:18 AM 6/25/2003 -0500, you wrote: Just a little update. I asked on the Jaxen-interest list about treating the HTML DOM in a case-insensitive manner. The one response I got made it sound like it isn't supported currently, but there is at least one (ugly) workaround.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Using XMLC without Compiling Classes, Jacob Kjome |
|---|---|
| Next by Date: | default for using ' in OutputOptions?, Jacob Kjome |
| Previous by Thread: | Re: output html as lower case?, Jacob Kjome |
| Next by Thread: | Re: output html as lower case?, Mark Diekhans |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |