Advertisement

03.10.2008 at 10:40PM PDT, ID: 23230890
[x]
Attachment Details

Namespace's

[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.6
Hello Experts,

I have an requirement to output an xml file...but failing to use some functions which required to do some process....
my saxon xslt contains something like in attached code snippet...

But while processing it throws and error like...

Error at xsl:variable on line 7 of file:/D:/Shailesh_Data/2007/Quagnito/Working/ADOBE_SYNC/xmedia-cms/Server/GEP/BuildScripts/ASDocs_Saxon9/AS3/Process/xsl/dita/SearchParse.xslt:
  XPST0017: XPath syntax error at char 20 on line 7 in {lookup:getInstance()}:
    Cannot find a matching 0-argument function named
  {java:com.adobe.gep.unicodelookup.UnicodeCharLookup}getInstance()
Error at xsl:variable on line 88 of file:/D:/Shailesh_Data/2007/Quagnito/Working/ADOBE_SYNC/xmedia-cms/Server/GEP/BuildScripts/ASDocs_Saxon9/AS3/Process/xsl/dita/SearchParse.xslt:
  XPST0017: XPath syntax error at char 39 on line 88 in {...tChar($lookup, $char, $loca...}:
    Cannot find a matching 3-argument function named
  {java:com.adobe.gep.unicodelookup.UnicodeCharLookup}getChar()
Failed to compile stylesheet. 2 errors detected.

Also i have an source file, which contains UnicodeCharLookup.java file which actually needs to be used as the xslt code looks for "lookup"

Can you pls suggest how to fixed this issue?

Thanks,
Sahilesh

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
Saxon XSLT
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://sf.net/saxon" xmlns:lookup="java:com.adobe.gep.unicodelookup.UnicodeCharLookup" xmlns:string="java:java.lang.String" exclude-result-prefixes="saxon lookup string">
	<xsl:output encoding="UTF-8" method="xml" indent="yes"/>
	<xsl:param name="locale">en-us</xsl:param>
	<xsl:param name="classFileName" select="'../../bin/dita/ClassHeader.xml'"/>
	<xsl:variable name="classHeader_map" select="document($classFileName)//apiPackage/apiClassifier/@id"/>
	<xsl:variable name="lookup" select="lookup:getInstance()"/>
	<xsl:template match="/">
		<dita>
			<xsl:apply-templates/>
		</dita>
	</xsl:template>
	<xsl:template match="node()[contains(@class,' topic/topic ')]
		[not(contains(@class,' mini-reference/mini-reference ') or
		contains(@class,' mini-task/mini-task '))]">
		<xsl:variable name="id" select="@id"/>
		<topic>
			<xsl:attribute name="id">
				<xsl:value-of select="@id"/>
			</xsl:attribute>
			<title>
				<xsl:variable name="titletext">
					<xsl:value-of select="apiName"/>
				</xsl:variable>
				<ph otherprops="unmodified">
					<xsl:value-of select="normalize-space($titletext)"/>
				</ph>
				<ph otherprops="parsed">
					<xsl:value-of select="lower-case($titletext)"/>
				</ph>
			</title>
			<body>
				<p>
					<xsl:apply-templates select="apiName/text()"/>
					<xsl:apply-templates select="node()[contains(@class,' topic/body ')]"/>
				</p>
			</body>
		</topic>
		<xsl:apply-templates select="node()[contains(@class,' topic/topic ')]
			[not(contains(@class,' mini-reference/mini-reference ') or
			contains(@class,' mini-task/mini-task '))]"/>
	</xsl:template>
	<xsl:template match="text()">
		<xsl:variable name="clean">
			<xsl:call-template name="replace">
				<xsl:with-param name="text">
					<xsl:call-template name="lowercase">
						<xsl:with-param name="text">
							<xsl:text> </xsl:text>
							<xsl:value-of select="normalize-space(.)"/>
						</xsl:with-param>
					</xsl:call-template>
					<xsl:text> </xsl:text>
				</xsl:with-param>
			</xsl:call-template>
		</xsl:variable>
		<xsl:analyze-string select="$clean" regex=" ">
			<xsl:matching-substring/>
			<xsl:non-matching-substring>
				<ph>
					<xsl:value-of select="."/>
				</ph>
			</xsl:non-matching-substring>
		</xsl:analyze-string>
	</xsl:template>
	<xsl:template name="replace">
		<xsl:param name="text">none</xsl:param>
		<xsl:call-template name="lookupChar">
			<xsl:with-param name="text">
				<xsl:value-of select="$text"/>
			</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<xsl:template name="lowercase">
		<xsl:param name="text">none</xsl:param>
		<xsl:value-of select="lower-case($text)"/>
	</xsl:template>
	<xsl:template match="node()[not(self::text())]" priority="-1">
		<xsl:apply-templates/>
	</xsl:template>
	<xsl:template name="lookupChar">
		<xsl:param name="text"/>
		<xsl:param name="flag"/>
		<xsl:if test="string-length($text) > 0">
			<xsl:variable name="char">
				<xsl:value-of select="substring($text,1,1)"/>
			</xsl:variable>
			<xsl:variable name="lookupChar" select="lookup:getChar($lookup, $char, $locale)"/>
			<xsl:choose>
				<xsl:when test="$lookupChar = ''">
					<xsl:text> </xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="$char"/>
				</xsl:otherwise>
			</xsl:choose>
			<xsl:call-template name="lookupChar">
				<xsl:with-param name="text">
					<xsl:value-of select="substring-after($text,$char)"/>
				</xsl:with-param>
				<xsl:with-param name="flag">
					<xsl:value-of select="$lookupChar"/>
				</xsl:with-param>
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>
Answered By: Gertone
Expert Since: 05/10/2005
Accepted Solutions: 2997
Computer Expertise: Beginner
Gertone has been an Expert for 3 years 8 months, during which he has posted 10363 comments and answered 2997 questions. Gertone is just one of 272 experts in the Extensible Stylesheet Language Transformation (XSLT) Zone. 1 expert collaborated on this answer, which was graded an "A" by the asker.
 
 
 
 
20081119-EE-VQP-47 / EE_QW_2_20070628