简体   繁体   中英

XQuery: produce element with attr also with value?

For example, I want to create such element below:

<book year="2010">Example name</book>

What is the correct usage of computed element constructor?

element book {
  attribute year { 2010 },
  'Example name'
}

Or some would suggest

element book {
  attribute year { 2010 },
  text { 'Example name' }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM