More XSLT fun
Posted by auzigog on 2008-10-28 02:14
Mike (I'm sending this to the list for archival purposes),
So I was trying to figure out why my code had twice as many points in
certain cases than the original code. I finally traced it down to this
part of the XSLT:
<xsl:if test="position() st()">
<xsl:apply-templates select="ToPoint" />
</xsl:if>
It basically says "ignore all <ToPoint> points unless it is the last
one in the segment"
This is because the data is laid out like this:
<Segment>
<FromPoint>
<x>1</x>
<y>1</y>
</FromPoint>
<ToPoint>
<x>2</x>
<y>2</y>
</ToPoint>
</Segment>
<Segment>
<FromPoint>
<x>2</x>
<y>2</y>
</FromPoint>
<ToPoint>
<x>3</x>
<y>3</y>
</ToPoint>
</Segment>
The "ToPoint"-'s are always duplicates of the next ForPoint except for
the very last ToPoint. Make sense?
Anyway, since that was done in XSLT, I didn't realize I would need to
compensate for it in the parser until the very last minute. Fun fun.
Jeremy
Home / Developer API / Tour / Get a Project - Solutions for Bug & Issue Tracking, Collaboration Tools, Subversion Hosting, Git Hosting
Ramani map is powered by Assembla.
0 Comments