I am parsing some xml using OPENXML. I need to get an Identity off of the XML to know the order of the nodes.
is @mp:id always in order? I know they are not sequential, but are they at least in order?
For example would the following query always produce results in the exact same order as the XML?
SELECT row_number() OVER (ORDER BY OrderID) rn,
StepID, CONVERT(varchar(max), CONVERT(VARBINARY(max), StepID), 2),
[ACTION]
FROM OPENXML(@idoc, 'descendant::step |descendant::compref', 2)
WITH ([OrderID] INT '@mp:id',
[StepID] INT '@id',
[Action] VARCHAR(max) 'parameterizedString[1]')
ORDER BY rn
or is @mp:id a meta data kind of thing that could go in any order based on how things are saved?