xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] How to add a xmlns:prefix attribute to an element
- From: Michael Kay <mike AT saxonica.com>
- To: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] How to add a xmlns:prefix attribute to an element
- Date: Wed, 11 Aug 2010 09:23:56 +0100
Have you tried
Element.addNamespaceDeclaration("custom", "http://example.com/opensearchextensions/1.0/");
Michael Kay
Saxonica
On 11/08/2010 07:49, Imran M Yousuf wrote:
Hi,
I am facing a little problem :).
http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_Query_element
I am trying to implement a DOM serialization and deserialization api
for this specification. A part of is to be able to write -
<Query xmlns:custom="http://example.com/opensearchextensions/1.0/"
role="custom:example"
searchTerms="cat"
title="Sample search" />
The problem is I can not add xmlns:* attributes as it rightly
identifies it as NS and throws an exception. But if I do provide an
URI for the role attribute that would behave wrongly as it will make
'role' under that NS with empty prefix. One way I am currently
employing to get around it is to use another dummy attribute, such as
custom:add="val" with the custom's NS, then it adds the xmlns
automatically. But I would not want to do it always.
Can you please suggest me how I could achieve just achieving the following?
<Query xmlns:custom="http://example.com/opensearchextensions/1.0/"
role="custom:example"
searchTerms="cat"
title="Sample search" />
Thank you,
-
[XOM-interest] How to add a xmlns:prefix attribute to an element,
Imran M Yousuf, 08/11/2010
-
Re: [XOM-interest] How to add a xmlns:prefix attribute to an element,
Michael Kay, 08/11/2010
- Re: [XOM-interest] How to add a xmlns:prefix attribute to an element, Imran M Yousuf, 08/11/2010
-
Re: [XOM-interest] How to add a xmlns:prefix attribute to an element,
Michael Kay, 08/11/2010
Archive powered by MHonArc 2.6.24.