[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Unparsed-text-available returns true for XML files

Subject: Re: Unparsed-text-available returns true for XML files, so how do I distinguish XML files?
From: "Mark Wilson" <mark@xxxxxxxxxxxx>
Date: Sun, 3 Jan 2010 09:02:30 -0800
Re:  Unparsed-text-available returns true for XML files
I use base-uri(/)  and the sub-string functions to distinguish file type.
Mark

--------------------------------------------------
From: "Brian Newman" <brian.newman@xxxxxxxxxxx>
Sent: Sunday, January 03, 2010 8:47 AM
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Unparsed-text-available returns true for XML files, so how do I distinguish XML files?


I've got a situation where I've got a number of files I need to transform. I don't know what kind of files they are going to be (they are anything from an enumerated list of file types, but can be anything from .mdb to .sql to .xml to .xls and so on). So, I need to test the file type and then process them accordingly.
I thought the way to do this was to have unparsed-text() handle unparsed text and have document() handle everything else - by attaching the appropriate URI Resolver. Then, if unparsed-text-available() returns true, I can send the file data to a named template to handle appropriately and if document-available() returns true, I can send to a matched template to do what it needs to do.
But, I've just discovered that unparsed-text-available() will return true for xml files. So, I don't know how to distinguish within my xslt which files are unparsed and which ones aren't.
I could use some guidance here, please.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.