Forum Moderators: open

Message Too Old, No Replies

A Pretty Important XSLT/XPath Question

Hello? Any XML Experts Wanna Weigh In On This?

         

cmarshall

12:15 pm on Apr 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Folks,

I'm starting a pretty ambitious XSLT project. I'm transforming Microsoft Excel XML files into inline XHTML for display on a wiki.

If anyone has seen the Excel schemas [microsoft.com], they know that this is not a project for the faint at heart.

In any case, a pretty universal Microsoft schema structure is to have a whole bunch of styles up front, and then reference those styles in attributes throughout the document.

The way that most people would render this would be to stick the styles into the <head>, and reference them through class attributes in the body.

Simple, no?

No.

As I mentioned, I'm transforming these inline, so that means that I need to make the styles actual "style" attributes, not class references. I may have three different spreadsheets on one Wiki page; each, with its own view of how a number should be formatted.

So, why do I need an expert opinion?

Simple. It seems, from my previous research [webmasterworld.com], that there is no way for XSLT to store persistent information. "Variables" are about as close as it comes, and I might be able to do it with them, but they are very, very stiff, primitive and awkward.

In any case, I may not have a choice, but I wanted to ask if anyone has any ideas on this issue. I have had incidents in the past, where I was trying to solve a problem with a spanner, and someone pointed out that a screwdriver would address the issue better [webmasterworld.com].

Any ideas?

There is so much hype about XML out there, and I get so many Google hits whenever I search, that there have got to be some experts willing to weigh in on this.

In my case, I've gotten zero help here. The books stink, the online stuff tends to be about 90% the same stuff, slightly repackaged and incompletely explained.

The biggest Issue I've had with learning XSLT is that no one seems willing come out and say "You just can't do that with XSLT/XPath." There seems to be some sort of unrwitten law that you should never mention limitations. Mentioning workarounds is an implicit admission of a limitation, so I don't see too many workarounds.

As someone who has come from a professional software engineering background, I know all about limitations, and I immediately started running into them as I was learning up on this stuff.

I expect to run into more.

And I never read the rules.

There, I hope that was enough of a glove on the ground to kick loose some experts.

davidpbrown

11:59 am on Apr 18, 2007 (gmt 0)

10+ Year Member



I'm not an expert so can't answer directly but if you don't get a reply here to specific XSLT questions, I'd suggest try the "Mulberry Tech XSL-List".. that's where the like of Michael Kay and Jeni Tennison answer questions.

cmarshall

12:13 pm on Apr 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks!

I'll give it a go!

cmarshall

4:40 pm on Apr 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just an update.

I did solve this issue. I was pointed to the XSLT [w3schools.com] / XPath [developer.mozilla.org] Key element/function.

I'll get around to working an example into my weetest.xml/xsd/xsl files, but that will be when I have the time.