XML module - hard coded XSL

143 views
Skip to first unread message

Alistair

unread,
Jul 9, 2010, 12:01:46 PM7/9/10
to jsTree
Hi,

I'm confused by jsTree's XML module. I'm using 1.0rc2. Specifically,
jsTree converts XML to an HTML list-based tree using XSLT. I couldn't
get my XML to render so checked out the source code; looks like the
XSL is hard-coded into jsTree's code and one particular line means it
will only work if you're root's child elements are called item;

<xsl:for-each select="$node/item">

Are you meant to update the source code with your own XSLT?

BTW, thanks for all your hard work - jsTree is awsome ;-)

vakata

unread,
Jul 11, 2010, 4:36:28 AM7/11/10
to jsTree
Hi,
thank you for the kind words!

As for the XSL - you could update the source and add your own XSL but
you could simply stick to the XML structure expected - it is up to
you. I would suggest sticking to the xml structure proposed by the
plugin (it is documented), as for example get_xml only supports those
two outputs (flat & nested).
Of course - you could even copy the XML plugin, and make your own XML
plugin, this way you will ensure that it continues to work when I
update the core, just name it to something different.

Kindest regards,
Ivan
Reply all
Reply to author
Forward
0 new messages