From: Aaron Patterson Date: 2010-10-20T08:08:00+09:00 Subject: Re: nokogiri xml namespaces --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 20, 2010 at 07:14:07AM +0900, Jonathan Rochkind wrote: > So when using nokogiri xml_element.xpath(path), you can pass a second > argument hash of alias to namespace URI, to use namespaces. >=20 > This works fine. But it's inconvenient to be passing the hash on every > call, when it's pretty much always the same hash, for several calls. >=20 > It seemed to me there ought to be a way to set the default namespace > alias mapping on the xml element itself, so it'll just stick for calls > on that element, and won't need to be explicitly passed in on every > xpath call. >=20 > nokogiri has generally such a convenient api that I figured this must be > there... but I haven't been able to find it. >=20 > Anyone know if it is? There is no API for doing this. However, I am open to suggestions. Could you write out in pseudo code (or ruby) what you're looking for? --=20 Aaron Patterson http://tenderlovemaking.com/ --45Z9DzgjV8m4Oswq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) iQEcBAEBAgAGBQJMviTFAAoJEJUxcLy0/6/Gfo8H/RlUOcoMMRDq8wJiuJZ8kByq KkOBJTdoDbCGYdCnuIim/RUMooS7V5W4uDcJFErzSPJ1R027UopIW5AAb2S2/HZ1 Ei7ZhDT5NaErb1GMP344d9A2i/liRiXQrk8S7IbYJOdg5rPzdfGftmvkzup5N3oF L6UfAD32xcY8t/uMdw21/9RRAE4x2L9z5X2dILGSOiOZSpLD6Hh9b4ofHGscntdH Zbp+mMRxkNpFMBpsbVZcevFO9hP5jqf90aqE4REN80xX4Pd9F4hF3Wq06w5Ql5fy 81mDHUTd4DNEN+o/9tCQczV+xbl+7ZJi4sL+09pcL/t5lFuQwbep/F0sjTNAPEM= =gjM6 -----END PGP SIGNATURE----- --45Z9DzgjV8m4Oswq--