Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • Dear Michael, I tried using your suggestion but it is not working. May be I am not adding in the proper place where it should be added. Entity2 is not my fixed name. It's can be any name but it should be unique in any path from root to leaf of a tree according to that image. Sorry, May be still i couldn't make you understand what actually I am trying to do. I am really sorry for that. If you check my Edit 2 then may be you will understand. thank you. Commented Oct 29, 2017 at 15:41
  • 1
    Well, you could put an assertion in the declaration of the root element that no element in the document may have a same-name descendant: that would be test="every $x in .//* satisfies empty($x//*[node-name(.) = node-name($x)])". Commented Oct 29, 2017 at 18:19
  • Dear Michael Kay, From last few days I am trying using your suggestion. I am also reading your book. But unfortunately, i couldn't solve that problem yet. I have added Edit 3 section. Please look at that section. I am really trying my best. I am requesting you to check that again. Please give me some suggestion so that I can complete this task. Commented Nov 4, 2017 at 18:25
  • You seem to have a document with "entity" as its root, and with another "entity" as a descendant. And you have an assertion that says no element may have a descendant with the same name. Your instance document clearly doesn't satisfy that assertion. Commented Nov 4, 2017 at 19:07
  • 1
    Perhaps you are confusing me (and perhaps yourself) by talking of the name of the element when you mean the value of the attribute named "name". Perhaps in your assertion you should replace node-name(.) by @name. Commented Nov 4, 2017 at 22:59