Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 16th, 2012, 06:36 AM
Authorized User
 
Join Date: Aug 2012
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
Default XSLT with SGML files??

Hi,

Can anybody please tell me if it's possible to run XSLT on non-XML files such as SGML?

I appreciate that XML is just a sub-set of SGML and therefore i would imagine it can be done, but I'm not sure if the XML declaration is required at the top of the file(s), or if there is any other reason why it wouldn't be possible without first converting to XML.

Thanks.
 
Old November 16th, 2012, 06:39 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

There are converters like http://www.jclark.com/sp/sx.htm that you can use to convert the SGML documents to XML first, then you can feed the XML documents to any XSLT processor.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
 
Old November 16th, 2012, 06:41 AM
Authorized User
 
Join Date: Aug 2012
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Thanks. So i take it that's a no then, without first converting to XML.
 
Old November 16th, 2012, 06:54 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Well depending on the platform or XSLT processor there might be an SGML parser you can simply plug into the chain of processing, for instance for .NET there was or might still be an SgmlReader class implementing the XmlReader API that is central to all other XML APIs in .NET so there you could use XslCompiledTransform for XSLT 1.0 or probably even Saxon 9 .NET for XSLT 2.0 and feed an SGML document to the XSLT processor, with a few lines of .NET code running the transformation.

Similar solutions might exist in the Java world, like there are ways to feed SGML based HTML 4 to XSLT with APIs like TagSoup.

But the primary input for XSLT is XML, not SGML. I think there is also a transformation language for SGML documents but I am not familiar with that.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
The Following User Says Thank You to Martin Honnen For This Useful Post:
Daedalus (November 16th, 2012)





Similar Threads
Thread Thread Starter Forum Replies Last Post
compare 2 xml files using xslt kirangentlebreeze1987 XSLT 1 February 21st, 2011 04:33 AM
Problem in Converting xml to sgml pragneshpandya XML 0 November 27th, 2006 01:52 AM
XSLT between two XML files NEO1976 XSLT 15 July 24th, 2006 08:52 AM
Compare two xml files using xslt sudha XSLT 0 March 10th, 2006 01:04 AM
BizTalk w/ SGML Saidin77 Biztalk 0 July 15th, 2003 08:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.