• 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

XSLT Limitations

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read that XSLT can not transform XML into a non-XML format. Is this true?
Is there an XSLT that can transform legal XML like this
<NAME>Joe</NAME>
into illegal XML like that shown below missing the end tag?
<NAME>Joe
Thanks,
Billy
 
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
It's the other way around, XSLT cannot read illegal XML (or non-XML) and transform into anything. Regarding your transformation, the only problem is that XSLT itself must be legal XML , so to achieve effect of illegality you would have to code "<" as an entity or/and to use <xsl:text> - this sort of tricks.
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Which will print <NAME>Joe
If you use it directly in xsl then the parser will throw error that to put matching eng-tag.
If u need more info on xsl utput methods,u can refer page 252 of Mike kay book.(if u have that book ?)
Hope this helps if not post ur question here.[/qb]<hr></blockquote>
[ July 11, 2002: Message edited by: Balaji Loganathan ]
 
Billy Hause
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do have the XSLT Programmers Reference by Michael Kay. I also have the XML Bible. In the XML Bible at the bottom of page 437-438 (under topic XSL Style Sheet Document) it states:
"You cannot use XSL to transform to or from non-XML formats like PDF, TeX, Microsoft Word, PostScript, MIDI or others."
It then goes on to say:
"XSL transformation language works for XML-to-XML conversions, not for anything else."
If XSLT can transform into anything, then why isn't there an XSLT to transform XSL FO into various popular formats such as PDF or Microsoft word? Currently you need a custom program to do it.
-Billy "sometimes doen't know what he's talking about" Hause
 
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
It then goes on to say:
"XSL transformation language works for XML-to-XML conversions, not for anything else."

Are you serious? I do not have this book, but... XSLT processor simply copies all text that is not XSLT operators to the output - you can put there whatever you want.
MS Word files are in binaty format, not fun to emulate. But conversion to RTF is possible.
Khun Yee Fung's "XSLT" book has a section describing a stylesheet to transform XML to PDF.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic