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

Re: Read a txt file

Subject: Re: Read a txt file
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 15 Dec 2004 12:26:13 GMT
file.txt
> I need my xsl reads a txt file, like this:

XSL1 can only read XML files, although you can easily make an xml file
wrapper around your text

if you have a file.txt that you know doesn't have any < or or > & characters
in it then you can make a file.xml that looks like

<!DOCTYPE vector [
<!ENTITY x SYSTEM "file.txt">
]]>
<vector>&x;</vector>


then in your xxslt you can go

<xsl:copy-of select="document('file.xml')"/>

and will get


<vector>
10101010101010101111010101010
10101011100001010101010101010
00011010101010101010101011011
</vector>


as the result.


>   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?

I have no idea what you mean here, you can have any structure you want
for example to express the matrix in mathml you'd have something like


<matrix>
  <matrixrow>
    <cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>1</cn><cn>1</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn>
  </matrixrow>
  <matrixrow>
    <cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>1</cn><cn>1</cn><cn>0</cn><cn>0</cn><cn>0</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn>
  </matrixrow>
  <matrixrow>
    <cn>0</cn><cn>0</cn><cn>0</cn><cn>1</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>1</cn><cn>0</cn><cn>1</cn><cn>1</cn>
  </matrixrow>
</matrix>

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.