[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Read a txt file
> I need my xsl reads a txt file, like this: > > > ------file.txt--------------- > > 10101010101010101111010101010 > 10101011100001010101010101010 > 00011010101010101010101011011 > > ----------------------------- > > I'd like to read this values and copy them in a xml > element: > > <vector> > 10101010101010101111010101010 > 10101011100001010101010101010 > 00011010101010101010101011011 > </vector> You can't do that directly in XSLT 1.0. In 2.0 it's simply: <vector> <xsl:value-of select="unparsed-text('file.txt')"/> </vector> In 1.0 you can pass the contents of the file into the transformation as the value of a string parameter, or you could use a URIResolver to wrap the text contents into an XML document structure. > > > > But I have other problem: > This values are of a multidimensional vector (matrix). > > > In XML, I can't have a element that has a vector > structure, can I? What could I do in this case? > <matrix> <row> <cell>0</cell> <cell>1</cell> </row> <row> etc. Michael Kay http://www.saxonica.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|