xsl-list
[Top] [All Lists]

Re: [xsl] Unparsed-text-available returns true for XML files, so how do I distinguish XML files?

2010-01-03 12:50:08
Hi,

If suffixes aren't enough to determine file type and you need to open it
to check type, why not try document-available first, and if it returns
false, then try unparsed-text-available?

ac



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.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--