xsl-list
[Top] [All Lists]

Re: [xsl] Xpath Syntax Issue

2012-06-24 14:08:17
Yes, I was getting a different result, but I think I've figured out
the problem. I had both 32 and 64 bit versions of libxslt installed.
When I deleted the 32 bit version, the transformation completes
successfully.

Thanks for all the help troubleshooting!

Nathan

On Sun, Jun 24, 2012 at 12:35 PM, Martin Honnen 
<Martin(_dot_)Honnen(_at_)gmx(_dot_)de> wrote:
Nathan Tallman wrote:

Sorry, here's my XSLT (remove.xsl):

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:s="http://www.sitemaps.org/schemas/sitemap/0.9";
    exclude-result-prefixes="s"



    <xsl:output method="xml" encoding="UTF-8" indent="yes"/>

    <xsl:strip-space elements="*"/>

    <!-- Standard copy -->
    <xsl:template match="*">
        <xsl:copy>
            <xsl:copy-of select="@*"/>
            <xsl:apply-templates/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="s:urlset/s:url[normalize-space(s:loc) = 'URL']"/>

</xsl:stylesheet>

XML Snippet (sitemap1.xml):
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9";
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
     xsi:schemaLocation="
     http://www.sitemaps.org/schemas/sitemap/0.9
     http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd";>

     <url>
          <loc>URL</loc>
          <lastmod>2012-06-23T13:37:27+00:00</lastmod>
          <changefreq>monthly</changefreq>
          <priority>1.0</priority>
     </url>
     ....
</urlset>

Command used in Linux:
xsltproc -o sitemapb.xml remove.xsl sitemap1.xml


When I run xsltproc here on the command line with your samples I get



<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
   http://www.sitemaps.org/schemas/sitemap/0.9
 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd";>
    ....
</urlset>

so that element has been removed.

Are you getting a different result?

I tried with

Using libxml 20707, libxslt 10126 and libexslt 815
xsltproc was compiled against libxml 20706, libxslt 10126 and libexslt 815
libxslt 10126 was compiled against libxml 20706
libexslt 815 was compiled against libxml 20706

on Windows.




--

       Martin Honnen --- MVP Data Platform Development
       http://msmvps.com/blogs/martin_honnen/




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


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