• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

xsl

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please analyze this code and what it doing
***insertPropertiesTag.xsl *****
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1" xmlns:saxon="http://icl.com/saxon" saxon:trace="no" extension-element-prefixes="saxon">
<xsl:param name="base-path" />
<xsl:param name="mdx-properties-file" />
<xsl:variable name="mdx-properties-root" select="document($mdx-properties-file)" />
- <xsl:template match="Catalog">
- <xsl:copy>
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
- <xsl:template match="MetadataTypeData">
<xsl:apply-templates select="MetadataItemData" />
</xsl:template>
- <xsl:template match="MetadataItemData">
<xsl:apply-templates />
</xsl:template>
- <xsl:template match="Name">
- <property>
- <name>
<xsl:value-of select="." />
</name>
- <value>
<xsl:value-of select="following-sibling::node()" />
</value>
</property>
</xsl:template>
<xsl:template match="Value" />
- <xsl:template match="caseId">
- <xsl:copy>
<xsl:value-of select="." />
</xsl:copy>
</xsl:template>
- <xsl:template match="documentSet">
- <xsl:copy>
- <xsl:for-each select="./*">
- <xsl:choose>
- <xsl:when test="name() = 'documents'">
- <xsl:copy>
- <xsl:for-each select="./document">
<xsl:variable name="path-name" select="concat($base-path , relativePath , '\',fileName)" />
<xsl:variable name="mdx-document-root" select="$mdx-properties-root/Root/DocumentData[Document = $path-name]" />
- <xsl:copy>
- <xsl:for-each select="./*">
- <xsl:choose>
- <xsl:when test="name() = 'emailMeta'">
<xsl:copy-of select="." />
</xsl:when>
- <xsl:when test="name() = 'properties'">
- <xsl:copy>
- <xsl:if test="../duplicate = 'false'">
<xsl:apply-templates select="$mdx-document-root/MetadataTypeData" />
</xsl:if>
</xsl:copy>
</xsl:when>
- <xsl:otherwise>
- <xsl:copy>
<xsl:value-of select="." />
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<properties />
</xsl:copy>
</xsl:for-each>
</xsl:copy>
</xsl:when>
- <xsl :o therwise>
- <xsl:copy>
<xsl:value-of select="." />
</xsl:copy>
</xsl :o therwise>
</xsl:choose>
</xsl:for-each>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>


command line argument-->
com.icl.saxon.StyleSheet
-o PCatalog.xml catalog.xml
./insertPropertiesTag.xsl
base-path=G:\Projects\SEDT\TestFolder\420\matched
mdx-properties-file=./wordMeta.xml

wordMeta.xml is a metadata file. thanks in advance




Edit Comment: Disabled smiles in this post.

- m
[ December 24, 2004: Message edited by: Madhav Lakkapragada ]
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please analyze this code and what it doing

If I am not missing anything, this code represents a style sheet to convert some xml into some other xml file.

Is that analysis correct or am I missing the point ?

- m
 
Manoj Raghuwanshi
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes Madhav you are correct.but it not giving the expected results where i am going wrong?can you please point out.thanks
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly is this transformation doing differently from what you expect?
 
Manoj Raghuwanshi
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i got the problem it is in
<xsl:variable name="mdx-document-root"
select="$mdx-properties-root/Root/DocumentData[Document = $path-name]"/>

run time values are
path-name=>c:\input\matched\xyz.doc
<Document>C:\INPUT\matched\xyz.doc</Document>

is there any way so that i can able to do a caseinsensitive comparison between these two variables?
 
Manoj Raghuwanshi
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lasse you read a lot of books.I go through your amazone review link.you are great.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Manoj Raghuwanshi:

is there any way so that i can able to do a caseinsensitive comparison between these two variables?



ummm....nope! XML, by nature is case sensitive.
The work around I use is to translate every thing to one case (either lower or upper) and then do the comparision on the resulting translated string.

That's one way to do a case-insensitive (well practically speaking) comparision.

- m
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic