Re: output html as lower case?

Mark Diekhans <[email protected]>
Newsgroups gmane.comp.java.enhydra.xmlc
Message-ID <[email protected]>
Hi Jake,

Jacob Kjome <[email protected]> writes:
> Check out David Li's JXPath demo.  The DOM is generated by XMLC and then 
> XPath is used to query nodes in the dom.  Try the following, for example...
> 
> xpath demo.XPath input/Test.html "/HTML/BODY/TABLE[@id='t2']"

Yes, haven't played with it, but I looked over it earlier and was very
impressed; I think he is on to something.

> Note that for XMLC-3.0, David plans on utilizing XPath to a great degree, 
> so this case-sensitivity stuff is really of important for that, but I'd 
> really like to see it resolved for the XMLC-2.2 release.

The string written for a tag is not actually under XMLC's control.  It uses
the name returned by Element.getTagName().   When it's parsing a document,
it obtains an element object by tag name: <PRE>, <pre>, and even <pRe>
will all return an instant of the same class.  When getTagName() is
called on the object, it will always return "PRE", regardless of the
input.

This behavior is part of the HTML DOM specification and differs from
the XML DOM.  

To match the behavior of the DOM it's operating on, it seems that XPath should
actually behave in a case-insensitive manner if it's operating on a HTML
DOM as opposed to an XHTML or other DOM.  But I don't know the XPath
spec, so I really can't say if this is a valid thing to do.

Mark
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.