Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 14th, 2006, 11:26 AM
Registered User
 
Join Date: Sep 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT process XML problem in XMLSpy

Hi

I am trying to prcess a xml file with xslt.

XML file:
----------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xbrl
    xmlns="http://www.xbrl.org/2003/instance"
    xmlns:link="http://www.xbrl.org/2003/linkbase"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:cbs-bus_2="http://xbrl.cbs.nl/bus/fs/ps/2006-03-15"
    xmlns:int-gcd-entr="http://www.xbrl.org/int/gcd/entry/2005-08-15"
    xmlns:int-gcd-exch="http://www.xbrl.org/int/gcd/exchanges/2005-08-15"
    xmlns:gen="http://www.ntp.nl/genbase"
    xmlns:cbs-bus="http://xbrl.cbs.nl/bus/2006-03-15"
    xmlns:ifrs-gp-typ="http://xbrl.iasb.org/int/fr/ifrs/gp/2005-05-15/types"
    xmlns:int-gcd-curr="http://www.xbrl.org/int/gcd/currencies/2005-08-15"
    xmlns:ff="http://www.xbrl.org/2005/role/restatedLabel"
    xmlns:int-gcd-cntr="http://www.xbrl.org/int/gcd/countries/2005-08-15"
    xmlns:iso4217="http://www.xbrl.org/2003/iso4217"
    xmlns:int-gcd-dt="http://www.xbrl.org/int/gcd/dt/2005-08-15"
    xmlns:ifrs-gp="http://xbrl.iasb.org/int/fr/ifrs/gp/2005-05-15"
    xmlns:int-gcd-lang="http://www.xbrl.org/int/gcd/languages/2005-08-15"
    xmlns:int-gcd="http://www.xbrl.org/int/gcd/cor/2005-08-15"
    xmlns:zak="http://www.belastingdienst.nl/2004/xbrl/zak"
    xmlns:nl-gcd="http://www.xbrl-ntp.nl/gcd/nl-gcd-2005-11-01">

  <context id="C1">
    <entity>
      <identifier scheme="http://www.bedrijfX.nl/bus">cbs-bus</identifier>
    </entity>
    <period>
      <instant>2006-01-01</instant>
    </period>
  </context>

  <context id="c2">
    <entity>
      <identifier scheme="http://www.bedrijfX.nl/bus">cbs-bus</identifier>
    </entity>
    <period>
      <startDate>2006-01-01</startDate>
      <endDate>2006-12-31</endDate>
    </period>
  </context>

  <unit id="u1">
    <measure>iso4217:EUR</measure>
  </unit>

</xbrl>

XSLT file
-------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<?altova_samplexml test.xml?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

    <xsl:template match="/">
        <html>
            <head>
                <title>Contexten en units validatie</title>
            </head>
            <body>
                <xsl:apply-templates/>
            </body>
        </html>
    </xsl:template>

    <xsl:template match="xbrl">
        <table>
            <tbody>
                <xsl:apply-templates select="context"/>
            </tbody>
        </table>
    </xsl:template>

    <xsl:template match="context">
        <tr>
            <td><xsl:value-of select="@id"/></td>
            <td><xsl:value-of select="entity/identifier"/></td>
            <td><xsl:value-of select="entity/identifier/@scheme"/></td>
        </tr>
    </xsl:template>

</xsl:stylesheet>

The xml file has quite lots of name spaces. I cannot get the right result back by using this xslt to process the xml above. But if I remove the name spaces from the tag <xbrl>, then it does work.

Anybody can give a hint? Thanks.

Xin
  #2 (permalink)  
Old September 14th, 2006, 11:35 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

please Google for

"XSLT FAQ default namespace"

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
  #3 (permalink)  
Old September 14th, 2006, 11:53 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

http://p2p.wrox.com/topic.asp?TOPIC_ID=49630

--

Joe (Microsoft MVP - XML)


Similar Threads
Thread Thread Starter Forum Replies Last Post
XMLSpy: copy data from excel, paste in XMLSpy 2004 xmler XML 1 November 26th, 2008 03:33 AM
Error in Xmlspy when running xslt script jastao XSLT 2 June 9th, 2008 04:11 PM
XML to XML with xslt problem bertvanpet XSLT 1 July 5th, 2007 06:25 AM
problem transforming XML using xslt micky3248 XSLT 7 August 18th, 2006 03:52 AM
xml and xslt problem astroflake XSLT 1 April 13th, 2004 06:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.