xsl-list
[Top] [All Lists]

Re: Read a txt file

2005-01-19 05:43:32
Hi David, 


 --- David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> escreveu: 
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 xslt you can go

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

and will get


<vector>
10101010101010101111010101010
10101011100001010101010101010
00011010101010101010101011011
</vector>


as the result.



Ok David, I did this.



  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 structure is exactly what I need, but how did you
do this? 



Thanks, Beatriz







=====
Beatriz Langiano
Mestrado em Informática
Universidade Federal do Paraná - Brasil


        
        
                
_______________________________________________________ 
Yahoo! Acesso Grátis - Instale o discador do Yahoo! agora. 
http://br.acesso.yahoo.com/ - Internet rápida e grátis

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



<Prev in Thread] Current Thread [Next in Thread>
  • Re: Read a txt file, Beatriz Langiano <=