Skip to main content
Question

Is it possible to add a prefix for UUID field values?


Forum|alt.badge.img

Error: Invalid content at [11,58]: cvc-datatype-valid.1.2.1: '5da6322c-9e7b-4e35-a604-e931d7f40072' is not a valid value for 'NCName'

Error: Invalid content at [11,58]: cvc-attribute.3: The value '5da6322c-9e7b-4e35-a604-e931d7f40072' of attribute 'gml:id' on element 'tran:Road' is not valid with respect to its type, 'ID'

Solution: If am editing the gml file line containing gml_id:5da6322c-9e7b-4e35-a604-e931d7f40072 to gml_id: "any_name"_5da6322c-9e7b-4e35-a604-e931d7f40072. Then it is not showing error. Features will be validated and successfully imported.How to rectify this other than editing manually.Please help. Thanks

2 replies

takashi
Influencer
  • May 9, 2018

Hi @vishnuedakkat93, if some elements in the GML document have "gml:id" attribute and you need to add an identical prefix to the value of every "gml:id" attribute, the XMLXQueryUpdater might help you. Assuming that an attribute called "_gml" stores the whole GML document, and  the version of GML is 3.2. If the GML version didn't match 3.2, need to modify the namespace declaration in the expression.

XQuery Expression:

declare namespace gml="http://www.opengis.net/gml/3.2";
for $x in //*[@gml:id]
let $newId := 'any_name_'||xs:string($x/@gml:id)
return replace value of node $x/@gml:id with $newId 

0684Q00000ArK3MQAV.png


Forum|alt.badge.img

Hi Takashi

I am so thankful to you. The specific issues has been solved. I used python for this.

 

Thank you for your help.

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings