[xsl] Getting values

Subject: [xsl] Getting values
From: "Sergio Lorenzo" <negpfe@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 29 May 2003 20:15:53 +0200
Thanks. In fact, I would like to parse the following HTML file:

<html>

    <head>

        <meta name ="Embassy of the US in Caracas, Venezuela"/>

        <meta name = "DC.Title" content = "Polycyclic aromatic hydrocarbon
contamination"/>

        <meta name = "dc.Creator" content = "Gogh, Vincent van"/>

        <meta name = "DC.Source" content = "http://a.b.org/manon/"/>

</head>

</html>





And I would like the output was:



<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
xmlns:dc="http://purl.org/dc/elements/1.0/";
xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#";>

    <rdf:Description rdf:about="http://a.b.org/manon/";>
<------------------------------------------------    I'M GETTING PROBLEMS TO
GET THIS VALUE



        <dc:Title>Polycyclic aromatic hydrocarbon contamination</dc:Title>

        <dc:Creator>Gogh, Vincent van</dc:Creator>









So, my XSLT engine is like following



<?xml version="1.0" encoding="UTF-8"?>

    <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:fo="http://www.w3.org/1999/XSL/Format";>

        <xsl:template match="/">



            <xsl:text disable-output-escaping="yes">&lt;</xsl:text>rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
xmlns:dc="http://purl.org/dc/elements/1.0/";
xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#";<xsl:text
disable-output-escaping="yes">&gt;</xsl:text>

             <xsl:text
disable-output-escaping="yes">&#13;&#10;&#9;&lt;</xsl:text>rdf:Description
rdf:about="           <----------------------- I WOULD LIKE TO GET THE VALUE
OF @content (in DC.Source)

          <xsl:apply-templates/>

        </xsl:template>

        <xsl:template match="meta">

            <xsl:if test="starts-with(@name,'DC.') or
starts-with(@name,'dc.')">

                <xsl:text
disable-output-escaping="yes">&lt;</xsl:text>dc:<xsl:value-of
select="substring-after(@name,'.')"/><xsl:text
disable-output-escaping="yes">&gt;</xsl:text>

                <xsl:apply-templates select="@content"/>

                <xsl:text
disable-output-escaping="yes">&lt;&#47;</xsl:text>dc:<xsl:value-of
select="substring-after(@name,'.')"/>

                <xsl:text disable-output-escaping="yes">&gt;</xsl:text>

            </xsl:if>

    </xsl:template>

</xsl:stylesheet>







Comments are in capital letters.

I don't know the way to get that value (http://a.b.org/manon/). Does any one
know how to parse it in the position above explained? Thanks a lot.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread