|
XHTML: Return General Node When Calling GetElement Methods: msg#00004java.enhydra.xmlc
I am hoping that someone might be able to answer this. Below are two very scaled down code examples. The first shows an html page and the java code to access the element once the html page has been compiled via xmlc. The second shows the same thing except for an XHTML file. In the second version, getElementSomeId() does not return an HTMLAnchorElement. Instead it returns a general element. Since element is the return type, a cast is needed to get anchor tag specific methods. Is there a way to make XHMTL generated objects act like HTML objects so no casting is needed? Index.html page: <a href=”#” id=”someId”>Click Here</a> Java code used to access someId: HTMLAnchorElement someId = indexHTML.getElementSomeId(); someId.getHref()… When using an XHtml file it looks like this: index.xhtml page: <a href=”#” id=”someId”>Click Here</a> Java code used to access someId: HTMLAnchorElement someId = (HTMLAnchorElement)indexHTML.getElementSomeId(); someId.getHref()… Thank you, Kyle Aaron aaronka@xxxxxxxxxxxxx ------------------------------------------------------------------------------ This message may contain confidential information, and is intended only for the use of the individual(s) to whom it is addressed. ==============================================================================
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: going through old patches...are these still relevant?, James Graves |
|---|---|
| Next by Date: | remove get/setForcCloseTags() methods from OutputOptions?, Jacob Kjome |
| Previous by Thread: | Re: going through old patches...are these still relevant?, Jacob Kjome |
| Next by Thread: | remove get/setForcCloseTags() methods from OutputOptions?, Jacob Kjome |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |