Showing posts with label xsl. Show all posts
Showing posts with label xsl. Show all posts

Tuesday, April 24, 2007

How to select a element without specific attribute?

I ran into this simple question in one of my task:
Here is how you select an element without a specific attribute:
B[@C=''] selects B that has no C attribute or has attribute
with empty value.

B[not(@C)] seelcts b that don't have a C attribute

B[not(@*)] selects B that have no attribute.
Please refer to here.

Wednesday, March 21, 2007

XMLSPY 4.4U external XSL transformer

Add SAXONb89n as external XSL transformer for XML Spy
Toos->Options->XSL->External XSL transformation program: C:\LearningZone\SAXON\SAXONb89n\bin\transform.exe -o %2 -s %1 %3

Add SAXONb89j as external XSL transformer for XML Spy
Toos->Options->XSL->External XSL transformation program:

X:\tools\java\j2sdk1.5.0_06-win32\bin\java -jar C:\LearningZone\SAXON\saxon8.jar -o %2 -s %1 %3

To use saxon 6.5.3:
X:\tools\java\j2sdk1.5.0_06-win32\bin\java -jar C:\LearningZone\SAXON\saxonDTS.jar -o %2 %1 %3

Friday, March 9, 2007

How to exclude the name space from xslt result?

One of my colleague asked me how to avoid the result xml file include the annoying name space from the elements when you are using xsl:copy.
Here is the solution:
add exclude-result-prefixes="saxon v00" into your xsl:stylesheet element in your xsl file.

omit-xml-declaration specifies whether the XSLT processor should output an XML declaration; the value must be yes or no. Please refer to here.