xsl-list
[Top] [All Lists]

Re: [xsl] transforming MRSS

2011-08-08 03:44:47
I fail to find a working example for transforming XML where tags have a
colon in their name... it's always only fragments of a solution which, of
course, do not work...

1) is there any *complete* example that shows how to do it? preferably for
MRSS...

All you need to do is define the namespace for the element for you are
trying to process at a higher point in the hierarchy that is the xml
that is your stylesheet.... so typically the root element as that's
highest point so it will be in-scope throughout the stylesheet file,
just like the 'xsl' namespace.


2) why does XSL have to be more complicated than (e.g.)
simplexml_load_file() from PHP? With all this crazy, over-complicated
namespace junk... (i mean xmlns:yaddayadda) that is broken or wrong in many
feeds anyways... why not just access a tag named <media:group> with
"media:group"?

It's not that complicated and it's not junk, you just haven't figured
it out yet.  You are probably still thinking of xml as a string
instead of a tree of nodes, and once you make that jump everything
else falls into place.

If you want to process <media:group> you need to know the namespace
being used for 'media' in the xml and then define that your in
stylesheet, and that's it, done.

-- 
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>