You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Adrian Herscu <bm...@fastmail.fm> on 2009/04/01 00:52:03 UTC

Re: cannot find the namespace declarations from an extension function

Upgraded to Xalan 2.7.1 and JDK 6.0 Update 13, still no luck :(
Any suggestions?
Adrian.

Adrian Herscu wrote:
> Hi all,
> 
> I am using Xalan 2.7.0. I am writing a large XSL application which 
> processes WSDL files. Because of the nature of WSDL files, this 
> processing requires a complex loop declaration just to traverse a 
> reference. Right now, the code looks like this:
> 
> <!-- key for looking up the wsdl:binding -->
> <variable name="binding-key">
>   <apply-templates select="." mode="binding-key" />
> </variable>
> 
> <for-each select="key('binding',$binding-key)">
> ...
> </for-each>
> 
> Imagine few nested loops like the one above...
> Hence, I want to simplify the code to look like:
> 
> <for-each select="myxslutils:ref(/wsdl:definitions/wsdl:binding,
>   'name', @binding, /wsdl:definitions/@targetNamespace)">
> ...
> </for-each>
> 
> Somewhere in my extension function I need to extract the namespace URI 
> of a given prefix. I tried the node.lookupNamespaceURI(prefix) method 
> but it returns with a null value :( Tried it on the root element also 
> and got the same result. Tried to enumerate the attributes of the root 
> element and the namespace attributes are not returned -- any clues?
> 
> The WSDL document is read using this method:
> 
> transformer.transform(new StreamSource(reader),
>             new StreamResult(writer));
> 
> where reader is a java.io.FileReader.
> 
> It seems like the namespace declarations are missing from the parse 
> tree. OTH, the transformations depend on these namespace declarations 
> and they work as expected.
> 
> Please help,
> Adrian.
> 
> 


Re: cannot find the namespace declarations from an extension function

Posted by Adrian Herscu <bm...@fastmail.fm>.
My XML environment now looks like:

       <checkEnvironmentExtension>
         <EnvironmentCheck version="$Revision$">
           <environment>
             <item key="version.DOM.draftlevel">2.0fd</item>
             <item 
key="java.class.path">C:\documents\pm\project-trunks\wirexn\sandbox\wsgui-gen\target\test-classes;C:\documents\pm\project-trunks\wirexn\sandbox\wsgui-gen\target\classes;C:\documents\pm\m2-repo\repository\commons-io\commons-io\1.4\commons-io-1.4.jar;C:\documents\pm\m2-repo\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar;C:\documents\pm\m2-repo\repository\junit\junit\3.8.2\junit-3.8.2.jar;C:\documents\pm\m2-repo\repository\xalan\serializer\2.7.1\serializer-2.7.1.jar;C:\documents\pm\m2-repo\repository\xalan\xalan\2.7.1\xalan-2.7.1.jar;C:\documents\pm\m2-repo\repository\xerces\xercesImpl\2.9.1\xercesImpl-2.9.1.jar;C:\documents\pm\m2-repo\repository\xml-apis\xml-apis\1.3.04\xml-apis-1.3.04.jar;C:\documents\pm\m2-repo\repository\xmlunit\xmlunit\1.2\xmlunit-1.2.jar;/C:/Documents 
and 
Settings/pm/.eclipse/org.eclipse.platform_3.3.0_1900124320/configuration/org.eclipse.osgi/bundles/302/1/.cp/;/C:/Documents 
and 
Settings/pm/.eclipse/org.eclipse.platform_3.3.0_1900124320/configuration/org.eclipse.osgi/bundles/300/1/.cp/</item>
             <item key="version.JAXP">1.1 or higher</item>
             <item key="java.ext.dirs">C:\Program 
Files\Java\jdk1.6.0_13\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext</item>
             <item key="version.xerces2">Xerces-J 2.9.1</item>
             <item key="version.xerces1">not-present</item>
             <item key="version.xalan2_2">Xalan Java 2.7.1</item>
             <item key="version.xalan1">not-present</item>
             <item key="version.ant">not-present</item>
             <item key="java.version">1.6.0_13</item>
             <item key="version.DOM">2.0</item>
             <item key="version.crimson">not-present</item>
             <item key="sun.boot.class.path">C:\Program 
Files\Java\jdk1.6.0_13\jre\lib\resources.jar;C:\Program 
Files\Java\jdk1.6.0_13\jre\lib\rt.jar;C:\Program 
Files\Java\jdk1.6.0_13\jre\lib\sunrsasign.jar;C:\Program 
Files\Java\jdk1.6.0_13\jre\lib\jsse.jar;C:\Program 
Files\Java\jdk1.6.0_13\jre\lib\jce.jar;C:\Program 
Files\Java\jdk1.6.0_13\jre\lib\charsets.jar;C:\Program 
Files\Java\jdk1.6.0_13\jre\classes</item>
             <item key="version.SAX">2.0</item>
             <item key="version.xalan2x">Xalan Java 2.7.1</item>
           </environment>
           <status result="OK"/>
         </EnvironmentCheck>
       </checkEnvironmentExtension>


Adrian Herscu wrote:
> Upgraded to Xalan 2.7.1 and JDK 6.0 Update 13, still no luck :(
> Any suggestions?
> Adrian.
> 
> Adrian Herscu wrote:
>> Hi all,
>>
>> I am using Xalan 2.7.0. I am writing a large XSL application which 
>> processes WSDL files. Because of the nature of WSDL files, this 
>> processing requires a complex loop declaration just to traverse a 
>> reference. Right now, the code looks like this:
>>
>> <!-- key for looking up the wsdl:binding -->
>> <variable name="binding-key">
>>   <apply-templates select="." mode="binding-key" />
>> </variable>
>>
>> <for-each select="key('binding',$binding-key)">
>> ...
>> </for-each>
>>
>> Imagine few nested loops like the one above...
>> Hence, I want to simplify the code to look like:
>>
>> <for-each select="myxslutils:ref(/wsdl:definitions/wsdl:binding,
>>   'name', @binding, /wsdl:definitions/@targetNamespace)">
>> ...
>> </for-each>
>>
>> Somewhere in my extension function I need to extract the namespace URI 
>> of a given prefix. I tried the node.lookupNamespaceURI(prefix) method 
>> but it returns with a null value :( Tried it on the root element also 
>> and got the same result. Tried to enumerate the attributes of the root 
>> element and the namespace attributes are not returned -- any clues?
>>
>> The WSDL document is read using this method:
>>
>> transformer.transform(new StreamSource(reader),
>>             new StreamResult(writer));
>>
>> where reader is a java.io.FileReader.
>>
>> It seems like the namespace declarations are missing from the parse 
>> tree. OTH, the transformations depend on these namespace declarations 
>> and they work as expected.
>>
>> Please help,
>> Adrian.
>>
>>
> 
>