[MOBY-dev] [moby] Problems using serviceInputParser method whenthe mobyservice receives multiple Simple inputs
Paul Gordon
gordonp at ucalgary.ca
Thu Mar 22 17:35:49 UTC 2007
This is the logic used in jMOBY's MobyPrefixResolver class too. Great
minds think alike :-)
One caveat related to Eddie's earlier code (I don't know if it's
applicable in the Perl implementation) is that a null namespace, and an
empty string namespace are different beasts in the XML DOM, and depend
on if the parser is in namespace-aware mode.
> This is how I do it in Perl/Moses code:
>
> # return a value of an attribute named $name from an $element (an
> # XML::LibXML type); try both with and without namespaces; return
> # undef if no such sttribute found
> sub getXMLAttribute {
> my ($self, $element, $name) = @_;
> return
> $element->getAttribute ($name) ||
> $element->getAttributeNS (MOBY_XML_NS, $name);
> }
>
> Martin
>
>
>
More information about the MOBY-dev
mailing list