Page 1 of 1
change attributes operation
Posted: Wed Nov 25, 2020 4:05 pm
by ptoegel
Hi,
i am building an oxygen framework to annotate xml files using the TEI-namespace. In the author mode i created an action to use the ChangeAttributesOperation (screenshot), but i can't figure out how. I always get the error "The attribute name is not valid XML" (translated from German, see photo). I tried without ", with ' around the namespace and attribute name and several other options.
Code:
({"
http://www.tei-c.org/ns/1.0"}ref)
({"
http://www.tei-c.org/ns/1.0"}corresp)
({"
http://www.tei-c.org/ns/1.0"}when)
Regards,
Philipp
- errorMessage.PNG (69.76 KiB) Viewed 5538 times
- changeAttributeOperation.png (110.59 KiB) Viewed 5538 times
Re: change attributes operation
Posted: Wed Nov 25, 2020 4:30 pm
by Radu
Hi,
Usually XML attributes are in no namespace, even if XML elements themselves are in a namespace.
So for your case you simply need to write:
https://en.wikipedia.org/wiki/XML_namespace
Attributes are never subject to the default namespace. An attribute without an explicit namespace prefix is considered not to be in any namespace.
Regards,
Radu
Re: change attributes operation
Posted: Wed Nov 25, 2020 5:11 pm
by ptoegel
Hi,
thank you very much. I was mislead by the information in the desciption of the argument, suggesting the use of a namespace:
"The names of the attributes to change/insert/remove, each on a new line. The provided values can be local names or Clark notations ({attribute_namespace}attibute_name)."
Regards,
Philipp
Re: change attributes operation
Posted: Thu Nov 26, 2020 4:02 pm
by Radu
Hi Philipp,
Right, I will correct the description of the parameter, the clark notation should be inserted directly as
{namespace}name and not with extra
() parenthesis around it.
But in the case of TEI almost all TEI attributes are in no namespace, they do not have an explicit namespace (as they do not inherit the namespace of the TEI elements).
There are only a couple of attributes which are namespaced and they all have prefixes like "xml:space". If you will ever want to set value for the "xml:*" attributes in TEI the clark notations will be for example
{http://www.w3.org/XML/1998/namespace}space because according to the XML specification the "xml" prefix is always bound to the
ttp://www.w3.org/XML/1998/namespace namespace.
Regards,
Radu