That is exactly what i needed! Thank you very much Andreas :D
2010/5/10 Andreas Weiler andreas.weiler@uni-konstanz.de
Hello Beatriz,
you can insert attributes like in the following example: xquery insert node attribute name{'value'} into /target
for updating attribute values use the following: xquery replace value of node //target/@name with 'value'
for renaming an attribute: xquery rename node //target/@name as 'value'
If you want to update more nodes in one query, you have to call like this: xquery for $node in //target return 'update function'
I hope this helps, don't hesitate to ask for more.
Kind regards, Andreas (BaseXTeam)
Beatriz Sancho schrieb:
Hello, I'm trying to update or create some attributes in a node. żhow can i do that with BaseX? This is my DTD:
<!ELEMENT SITUATION ((ROLES)?,(USERS)?,(GROUPS)?,(OBJECTS)?)>
<!ATTLIST SITUATION id ID #REQUIRED name CDATA #IMPLIED desc CDATA #IMPLIED start CDATA #IMPLIED finish CDATA #IMPLIED>
category_scope (small | large | community | other) #IMPLIED size_scope CDATA #IMPLIED environment ( synchronous | asynchronous | face-to-face |
blended | others) #IMPLIED educational_level CDATA #IMPLIED experience_level (none|elementary|advanced|expert) #IMPLIED>
and i want to update or create attributes in the SITUATION node. I have seen a function called insertAttributes but i don't know how to use it with baseX, with the prefix basex: it doesn't works... i am a little lost. Could you help me, please?
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk