Is there an easy way in REXML to get the namespace that is associated with a
given prefix?
···
WARNING: All e-mail sent to and from this address will be received or
otherwise recorded by the A.G. Edwards corporate e-mail system and is
subject to archival, monitoring or review by, and/or disclosure to,
someone other than the recipient.
Message-ID: 89539780CB9BD51182270002A5897DF602C6D670@hqempn04.agedwards.com
Is there an easy way in REXML to get the namespace that is associated with a
given prefix?
You can use REXML::Element#namespace if you are using a-la DOM API.
----------Example-----------------
require ‘rexml/document’
xml = <<XML
<?xml version='1.0'?>
XML
doc = REXML::Document.new(xml)
p doc.root.namespace(“fuga”)
p doc.elements[“/a/b”].namespace(“fuga”)
p doc.elements[“/a/b/c”].namespace(“fuga”)
p doc.elements[“/a/d”].namespace(“fuga”)
----------Example-----------------
----------Output------------------
“foo”
“foo”
“hoge”
“bar”
----------Output------------------
···
From: “Volkmann, Mark” Mark.Volkmann@AGEDWARDS.com
Subject: REXML namespace support
Date: Fri, 27 Sep 2002 22:45:45 +0900
======================
Kouhei Sutou
kou@cneti.net