• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Namepace problem with Xalan/XSLT

 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm getting quite frustrated due to what appears to be a major omission in XML/XSLT functionality in Xalan.
I want to take a news feed in RDF - meaning someone else has formatted the XML - and convert it to HTML. The offending syntax is as follows:

Unless I misunderstand, the "title" element inherits its namespace, so the canonical equivalent should be <rdf:title>XYZZY</rdf:title>.
However there doesn't appear to be any way to select this element in Xalan. Neither the pattern "title" NOR "rdf:title" will match, though a wildcard match will retrieve the element - along with a lot of unwanted baggage.
If I change the title element to its canonical equivalent, I can get a match on "rdf:title". However, since I am not generating this XML, that's not a viable solution. I could, of course, convert it, except that this would require coding some XSL to repair the defect and that would fail for the same reason.
Any suggestions?
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim,
<xsl:template match="*[local-name()='title']">
seems work, but there is some mystery, because other varants (rdf:title) should work also. Need more time for investigation...
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got it.
Run this stylesheet (thank you, Bob DuCharme) and we learn that "title" is in defaul namespace.

This stylesheet works for me:

[ April 08, 2003: Message edited by: Mapraputa Is ]
 
Tim Holloway
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AHHH! Blessings upon your house, O Great One!
So much for allegedly inherited namespaces. Also out-of-date documentation. That diagnostic transform is worth its weight in gold!
Still seems like they should've come up with a notation to explicitly shift to the default workspace
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic