|
Posted by Tony Marston on 12/16/14 11:57
I think you are trying to do too much with DOM. In my framework all screens
are built using XSL transformations, which means that I must have
intermediate XML files to hold all the data that is going to be used by the
XSL stylesheet. I never use XML files to manipulate data, just to hold the
data which is to be passed to an XSL stylesheet. Each XML document has to be
written to the structure expected by the stylesheet, and once it has been
transformed the XML document is discarded.
I do not use XML documents for persistent storage, they are transient -
created, processed, discarded.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
<ReGenesis0@aol.com> wrote in message
news:1157438238.086214.187580@74g2000cwt.googlegroups.com...
> So, I'm workign with XML in PHP5.
> I like it. I finally worked out the trick of doing xsl
> transformation with libxslt. Load tree, make transformation, yay!
>
> But I'm missing a middle step somewhere. Creating DOM trees from
> variables in memory, or manipulating data in trees loaded in.
> firstChild nextChild seems... awfully comborsome, and of limited use
> unless you already know the structure of the DOM tree you're parsing.
>
> Does the trick lie somewhere in DOM's awkward support of xPath? I
> accept that I will be building functions (or more liekly classes) to
> proctor my manipulations of these dom trees, but I just... I have yet
> to figure our the TRICK of manipulatign them in some sane,
> non-soul-destroying manner.
>
> I suspect that I'm just looking at thigns sideways, and if someone
> were to turn me around so I'm facing the problem right, everything
> would call into place like an optical illusion. All the DOM examples I
> read online seem to be just how do very baic 'create a list' sort of
> stuff, or readign from simple trees, not multi-level nested stuff,
> possibly with the same tag-name appearign at different level of the
> hierarchy.
>
> POWER-DOM? Do such tutorials exist? Is there a book? I just
> need... to know how to approach this.
>
> -Derik
>
Navigation:
[Reply to this message]
|