Search found 89 matches

by jkmyoung
Wed Dec 24, 2008 7:58 pm
Forum: XSLT and FOP
Topic: count in XSLT, Need Help Please !!!
Replies: 2
Views: 2537

Re: count in XSLT, Need Help Please !!!

My guess. Change:
<td><xsl:value-of select="count(//STATUS[.=current()/STATUS])"/></td>
to
<td><xsl:value-of select="count(.//STATUS[.=current()/STATUS])"/></td>
by jkmyoung
Mon Jun 09, 2008 5:17 pm
Forum: XSLT and FOP
Topic: newbie xslt help
Replies: 1
Views: 2310

Re: newbie xslt help

Post your XSLT, and it'll be easier to see where you're going wrong.
by jkmyoung
Thu Mar 27, 2008 6:42 pm
Forum: XSLT and FOP
Topic: Pairing Elements XSLT
Replies: 5
Views: 3412

Re: Pairing Elements XSLT

Add this before your other module template:
<xsl:template match="module[position() mod 2 = 0]">
<xsl:apply-templates/>
</xsl:template>
by jkmyoung
Tue Mar 11, 2008 6:24 pm
Forum: XSLT and FOP
Topic: Javax.xml.transform.:Had IO Exception with stylesheet file
Replies: 3
Views: 5118

Re: Javax.xml.transform.:Had IO Exception with stylesheet file

Does it work if you do not use localhost, but instead point to a file on your computer, or using a URL without localhost?
by jkmyoung
Mon Mar 03, 2008 5:09 pm
Forum: XSLT and FOP
Topic: Counting level of grandparent nodes
Replies: 4
Views: 3782

Re: Counting level of grandparent nodes

?maybe
<xsl:value-of select="count(preceding::C)"/>
by jkmyoung
Fri Feb 29, 2008 6:28 pm
Forum: General XML Questions
Topic: how to compare xml elemets in xslt
Replies: 2
Views: 4536

Re: how to compare xml elemets in xslt

Muenchian grouping http://www.jenitennison.com/xslt/grouping/muenchian.html <xsl:key name="xmltypesByLob" match="Xmltype" use="lob/@NAME"/> <xsl:for-each select="/root/Xmltype[count(.|key('xmltypesByLob', lob/@NAME)[1]) = 1]"> <xsl:text>LegalEntityOwner:</xsl:...
by jkmyoung
Wed Feb 27, 2008 10:31 pm
Forum: XSLT and FOP
Topic: building XML where elements can contain themselves
Replies: 6
Views: 3651

Re: building XML where elements can contain themselves

I realize now I made a couple mistakes, particularly in the first apply-templates choice in the default template. Revised code: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding=&quo...
by jkmyoung
Fri Feb 15, 2008 8:05 pm
Forum: XML Schemas
Topic: Count number of elements with a given attribute
Replies: 2
Views: 11137

Re: Count number of elements with a given attribute

What are you using to process the xml? xslt? If you can use xpath, then the queries are: "count(//Msg[@Direction='Send'])" "count(//Msg[@Direction='Receive'])" Also, if you're using xslt, you can have a special if clause when processing the first Receive <xsl:template match="...
by jkmyoung
Wed Feb 13, 2008 6:22 pm
Forum: XSLT and FOP
Topic: item-at()?
Replies: 5
Views: 4245

Re: item-at()?

No.
All XSLT processors I've seen, including Microsofts, start at array index 1.

You may be thinking of C# or C++ where they start at 0, as is the norm, (eg compared to Java, php, perl, etc..)
by jkmyoung
Tue Feb 12, 2008 1:17 am
Forum: XSLT and FOP
Topic: item-at()?
Replies: 5
Views: 4245

Re: item-at()?

Also note that node lists in xslt start at position() 1, not 0.
by jkmyoung
Tue Feb 12, 2008 1:15 am
Forum: XSLT and FOP
Topic: building XML where elements can contain themselves
Replies: 6
Views: 3651

Re: building XML where elements can contain themselves

Use a key to reference the previous item. Making this work for nested groups was a little of a hassle. Reply back if you have any questions. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" ...
by jkmyoung
Mon Feb 04, 2008 6:01 pm
Forum: XSLT and FOP
Topic: Question regarding strings and spaces...
Replies: 2
Views: 2961

Re: Question regarding strings and spaces...

Strange. The output I get with the last 2 files is: <CARS> <YEAR>2006 </YEAR> <MAKE>kia</MAKE> <MODEL> spectra</MODEL> <YEAR>2007 </YEAR> <MAKE>NISSAN</MAKE> <MODEL> MAXIMA</MODEL> </CARS> Also you might want to use instead: <xsl:variable name="model"> <xsl:value-of select="substring-...
by jkmyoung
Wed Jan 30, 2008 12:10 am
Forum: XSLT and FOP
Topic: Newbie XSLT question
Replies: 1
Views: 2145

Re: Newbie XSLT question

Could we see the context in which it is used? Did you need to select all of the @Tier nodes?

It might take 2 steps. I think it'd be something closer to:
select = "Intro[@Tier != '' and Purchase/@APR!='None']/@Tier[not( (Purchase/@APR != //Goto[@Tier = *]/Purchase/@APR))]
by jkmyoung
Thu Jan 24, 2008 9:28 pm
Forum: XSLT and FOP
Topic: How to remove unwanted whitespace from an XML element?
Replies: 4
Views: 9910

why not add a text handling template?

<xsl:template match="text()">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template>
by jkmyoung
Wed Jan 23, 2008 9:24 pm
Forum: XSLT and FOP
Topic: Parsing and counting using XSLT
Replies: 3
Views: 5133

I would suggest creating a temporary result for each name, with each name parsed out. eg temporary result would be: <name>Robart J</name> <name>Alex M</name> <name>Peter R</name> <name>Alex M</name> <name>Robart J</name> <name>Dave T</name> Then use the count() function to do it. It would be easier ...
by jkmyoung
Fri Jan 18, 2008 5:50 pm
Forum: XSLT and FOP
Topic: strange problem with apply-templates select="..."
Replies: 2
Views: 3159

Where are your jaal:bannertab1 and jaal:bannertab2 templates??
by jkmyoung
Mon Jan 14, 2008 8:01 pm
Forum: XSLT and FOP
Topic: Apply-templates with-param problem / question
Replies: 7
Views: 5273

Another alternative to wieldly nested choose clauses is this little trick: <my:mapping xmlns:my="internal"> <month short="1" abr="Jan" long="Januar" /> <month short="2" abr="Feb" long="Februar" /> <month short="3" abr=&q...
by jkmyoung
Fri Jan 11, 2008 6:55 pm
Forum: XSLT and FOP
Topic: Apply-templates with-param problem / question
Replies: 7
Views: 5273

For further clarifications, the exsl namespace will work in saxon, not IE, and I don't know about firefox and opera.

(annoying that you can't edit posts)
by jkmyoung
Fri Jan 11, 2008 6:53 pm
Forum: XSLT and FOP
Topic: Apply-templates with-param problem / question
Replies: 7
Views: 5273

Saxon 9 is a XSLT 2.0 processor is it not? As such it would probably ignore these errors. The behaviour that is correct is throwing the error. If you're looking for compatibility, why not use the exsl:node-set extension? xmlns:exsl="http://exslt.org/common" ... <xsl:with-param name="m...
by jkmyoung
Tue Dec 11, 2007 6:57 pm
Forum: XSLT and FOP
Topic: Copy XML replacing selected node contents in XSLT (2.0)
Replies: 3
Views: 3666

Start off with a copy template --- <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:template match="*"> <xsl:copy> <xsl:...
by jkmyoung
Mon Dec 03, 2007 5:31 pm
Forum: XSLT and FOP
Topic: How to Sort XML message
Replies: 1
Views: 2630

<xsl:for-each select="List">
<xsl:sort select="EMID"/>
<xsl:copy-of select="."/>
</xsl:for-each>
by jkmyoung
Tue Nov 20, 2007 1:25 am
Forum: XSLT and FOP
Topic: Trying to display tagname
Replies: 11
Views: 6822

Change your template to:
<xsl:template match="/content">

And your for-each to:
<xsl:for-each select="*">
by jkmyoung
Thu Nov 15, 2007 7:36 pm
Forum: XSLT and FOP
Topic: Trying to display tagname
Replies: 11
Views: 6822

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
by jkmyoung
Wed Nov 14, 2007 5:37 pm
Forum: XSLT and FOP
Topic: Trying to display tagname
Replies: 11
Views: 6822

You probably need version="1.0" in your stylesheet node.
by jkmyoung
Tue Nov 13, 2007 5:39 pm
Forum: XSLT and FOP
Topic: How to get current URL in xsl
Replies: 1
Views: 4964

You'd have to pass it in as a parameter to the xsl. If you're simplying applying the xsl by using a processing instruction, eg
<?xml-stylesheet type="text/xsl" href="styles.xsl"?>
then this isn't possible.
by jkmyoung
Tue Nov 13, 2007 5:38 pm
Forum: XSLT and FOP
Topic: Trying to display tagname
Replies: 11
Views: 6822

Also you might want to change your xsl namespace to the standard one.
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

It really looks like your xslt should work otherwise.
by jkmyoung
Tue Nov 13, 2007 5:36 pm
Forum: XSLT and FOP
Topic: Trying to display tagname
Replies: 11
Views: 6822

Is content the first node in your xml source? What output are you getting right now?
by jkmyoung
Tue Nov 13, 2007 5:32 pm
Forum: XSLT and FOP
Topic: XPath ok, XSLT not
Replies: 2
Views: 3215

I believe you're not allowed to use the descendant-or-self axis in the match pattern.
You might want to try something like this instead with a inverted condition instead:
<xsl:template match="node()[ancestor-or-self::body]">
by jkmyoung
Thu Nov 08, 2007 9:44 pm
Forum: XSLT and FOP
Topic: XSLT Query
Replies: 3
Views: 3113

would be more like
select="employee[employeeValue >= 5000 and employeeValue <= 10000]"
by jkmyoung
Thu Nov 08, 2007 9:43 pm
Forum: XSLT and FOP
Topic: XSLT Query
Replies: 3
Views: 3113

arghh. no edit on this forum. forgot the ='s
select="employeeValue >= 5000 and employeeValue <= 10000"