xsl-list
[Top] [All Lists]

Converting delimited text WITH <br> to string

2004-06-21 21:46:07
Friends,
I guess I missed the answer to this one. I have read a lot of FAQs,
but I have not found my particular answer.

All I want to do is to compare an XML file with a text file.

My desire is to convert the text file into a string then compare the
data in it to the XML nodes. However, the text file always gets
parsing errors.

The text file has is exported from a OLD database, but the fields do
have <br> and other sloppy html in them.

I would edit them, but there are over 300 of them all in different
folders (lucky for me they are on the same server).

Here is the URL.

http://lcweb2.loc.gov/music/ftp/951201/06180001/ftscript.data

Thanks,
Mike F.
Washington, DC

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [ 
<!ENTITY lll SYSTEM
"http://lcweb2.loc.gov/music/ftp/951201/06180001/ftscript.data";>
<!ENTITY nbsp "&#x20;">
<!ELEMENT br (EMPTY)>
<!ELEMENT BR (EMPTY)>
]>

<xsl:stylesheet 
        version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
        xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
        xmlns:html="http://www.w3.org/1999/xhtml"; 
        exclude-result-prefixes="html xs" 
  xmlns:saxon="http://icl.com/saxon";
  extension-element-prefixes="saxon"

<xsl:output 
        version="1.0" 
        method="html" 
        indent="yes" 
        encoding="utf-8" 
        omit-xml-declaration="no" 
        standalone="no" 
        media-type="text" 
        cdata-section-elements="br"
/>

<xsl:template match="/">
<X>
<xsl:copy-of
select="document('http://lcweb2.loc.gov/music/ftp/951201/06180001/ftscript.data')//*"/>
<xsl:apply-templates
select="document('http://lcweb2.loc.gov/music/ftp/951201/06180001/ftscript.data')//text()
| *"/>
<xsl:copy-of
select="document('http://lcweb2.loc.gov/music/ftp/951201/06180001/ftscript.data')//text()"/>
<xsl:text>&lll;</xsl:text>
</X>
</xsl:template>

</xsl:stylesheet>




                
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail


<Prev in Thread] Current Thread [Next in Thread>