Hi Michael,
I am using XQuery, it returns empty sequence.

query -sa -val:strict -s:test.xml -xsd:C:\Users\malix\Cache\http\www.xbrl.org\2003\xbrl-instance-2003-12-31.xsd;test.xsd -q:test.xq

where as
C:\Users\malix\Cache\http\www.xbrl.org\2003\xbrl-instance-2003-12-31.xsd is a local copy of
http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd

test.xq:

import schema "http://www.xbrl.org/2003/instance";
declare namespace xbrli="http://www.xbrl.org/2003/instance";

//*[. instance of schema-element(xbrli:item) or . instance of schema-element(xbrli:tuple)]   

Do you have any suggestions?

Thanks a lot
Malix

On Thu, Feb 10, 2011 at 1:24 AM, Michael Kay <mike@saxonica.com> wrote:
On 10/02/2011 07:33, Malix Ren wrote:
> //*[. instance of schema-element(xbrli:item) or . instance of
> schema-element(xbrli:tuple)]

It works for me.

With your schema in test.xsd, your source document in test.xml, and this
stylesheet in test.xsl:

<xsl:stylesheet version="2.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:output indent="yes" encoding="iso-8859-1"/>

<xsl:import-schema namespace="http://www.xbrl.org/2003/instance"/>

<xsl:template match="/">
<tests>
<xsl:copy-of select="//*[. instance of schema-element(xbrli:item) or .
instance of schema-element(xbrli:tuple)]"/>
</tests>
</xsl:template>

</xsl:stylesheet>

this command

java net.sf.saxon.Transform -s:test.xml -xsl:test.xsl -val:strict
-xsd:test.xsd

produces this output

<?xml version="1.0" encoding="iso-8859-1"?>
<tests xmlns:xbrli="http://www.xbrl.org/2003/instance">
<concept:d1 xmlns="http://www.xbrl.org/2003/instance"
               xmlns:concept="http://xbrl.org/formula/conformance/example"
               xmlns:link="http://www.xbrl.org/2003/linkbase"
               xmlns:xlink="http://www.w3.org/1999/xlink"
               xmlns:iso4217="http://www.xbrl.org/2003/iso4217"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               contextRef="context"
               xsi:nil="true"/>
</tests>

I think the most likely explanation is that you ran the XPath expression
on an unvalidated (and therefore untyped) version of the XML source
document (note the -val:strict on the command line).

Michael Kay
Saxonica


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help