Re: Xpath

Tim Brody <[email protected]> Mon, 17 Dec 2012 12:11:31 +0000
Newsgroups gmane.comp.lang.perl.xml
Message-ID <EMEW3|342461269b3a1fe0566ad34f79853525oBGCBe04tdb2|ecs.soton.ac.uk|[email protected]>
--===============0272787602==
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature";
	boundary="=-yJxu9h9Y+xXu+hTw2vMK"


--=-yJxu9h9Y+xXu+hTw2vMK
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, 2012-12-14 at 22:31 +0100, Jenda Krynicky wrote:
> From: Tim Brody <[email protected]>

> And before someone starts to babble about the need to stop thinking=20
> proceduraly, because XSLT is functional ... I've worked with=20
> functional languages. With lazy, purely functional languages to be=20
> exact. The problem doesn't lie in XSLTs purported functionality. It=20
> lies in its braindead syntax.

I've never struggled with that, but then I use an editor (vim) that
highlights <xsl:> tags.

<xhtml:em><xsl:value-of select=3D"/foo" /></xhtml:em>

vs.

my $foo =3D $dom->documentElement->findnodes("/foo")[0];
my $em =3D $dom->createElementNS( "http://w3.org/???", "em" );
$frag->appendChild($em);
$em->appendChild($foo->textContent());

I've written plenty of both, but in my experience writing a bit of XSLT
can save me from writing a lot of XML bootstrap code in a procedural
language.

Everyone has their preferred tools. If you have a better approach for
processing XML please share.

/Tim.

--=-yJxu9h9Y+xXu+hTw2vMK
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAABAgAGBQJQzwvzAAoJECwwMWpSkLVcZz4IAIKb9WHUm0/LVfCXZytVOZrL
woKpyg/wT7UhfaAq8O/81lHOE/HCURETyNdt/bVrVEFtDEbAQjcNIMsNZuVt9W7S
CNjQmGx7uXICeBa/bHd+WAnX/27bBCp3yapx1mZ4fWaWjO3NFs2/5PEUc7j18B4Z
oW4yXmyWkgBl9NocBXa7OJIzZzwNW45WhPYHp0jRvpN3yLiDiBY43IfWZtm4E6Kq
/VtVbAHA5yyJroCgWqI6VBY94qWKuFyE4eBX1dPvvMDPtzj6HldRPrXDPn+5wb4D
wtoAFTQMc0zBwu4IXOQptzZEkLIFOdVg7FjmeX1JhBXkgkyAljTEC0STP+IbCRI=
=t+Vx
-----END PGP SIGNATURE-----

--=-yJxu9h9Y+xXu+hTw2vMK--


--===============0272787602==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

--===============0272787602==--