views:

28

answers:

1

Is the case of the "id" attribute important, when creating a reference to an element for digital signing following xml-dsig standard?

I've seen attributes named "ID", "Id" and "id" and some software packages have trouble finding the correct element/node for different forms.

Also following various specs and schemas, there are different id attributes expected.

For sure the attribute must be named "id", but is the case specified or are there only recommendations?

A: 

(Note: You must know that I am not an xml-dsig expert, so I am only answering as far as XML, DTD and XML Schema are concerned.)

XML is case sensitive, so the case is important and must be the same as in the DTD or Schema which you are using.

Of course if applications use different schemas with different cases, there is a compatibility issue.

I looked at the official W3C specification at http://www.w3.org/TR/xmldsig-core/ and the Schema and DTD seem to specify "Id". Is this the specification you are using?

Also, it might be confusing to know that the corresponding DTD type is "ID" and that there is an XQuery function called "id".

xqib-team
I have no problem in understanding the importance of case-senstivity as far as XML and schema goes, have designed plenty of both...I have "problems" using references for signing XML elements.Which part of xmldsig-core does specify the case of target id attribute? I can see for example that the xml-dsig element Signature has a upper case Id as an attribute. But where does it say that the "target" attribute, the one being used as a reference in the SignedInfo.Reference element, must be upper-case?
andrazk
Say I want to sign the Data element of this xml:<Document><Data id="myRef">blah blah blah</Data></Document>Which case should the attribute "id" be? Pay attention, there is no schema involved!Most of the software I've used works with "id" or "ID" or "Id". Some works only with "Id".But is there a rule about it?Anyway, the xml parser should somehow "guess" where the signature reference points, since it doesn't know the schema and attribute types...
andrazk