I'm not entirely clear on your question ... do you want to generate
attributes or read them ?
Presuming you mean read the attributes and print them, the trick is the
"@" say for example
Given
<meta name="name" content="value"/>
Print out
Meta name is name
Meta content is value
Use
Meta name is {$article/bk:meta/@name/string()}
Meta content is {$article/bk:meta/@content /string()}
From: [email protected]
[mailto:[email protected]] On Behalf Of Roland
Butler
Sent: Tuesday, November 24, 2009 7:40 AM
To: [email protected]
Subject: [MarkLogic Dev General] Novice question: How to access
namedattributes of an element
I am able to use xquery to display the text associated with an element
as follows
<title type="main">Document Title</title>
<h1>{($article/bk:head/bk:title/text())}</h1>
But how can I get to attribute of an element?
<meta name="name" content="value"/>
I want to print out the value text but don't know how?
Regards,
Roland Butler
________________________________
***CONFIDENTIALITY NOTICE & DISCLAIMER***
This message, together with any attachments, is for the confidential and
exclusive use of the intended addresses(s).
If you receive it in error, please delete the message and its
attachments from your system immediately and notify us
by e-mail [email protected]
Do not disclose, copy, circulate or use any information contained in
this e-mail.
The content of this e-mail is to be read subject to our terms of
business, as applicable.
E-mail may be intercepted or affected by viruses and we accept no
responsibility for any interception or liability for any
form of viruses introduced with this e-mail.
The sender shall remain solely accountable for any statements,
representations or opinions that are clearly his or her
own and not made in the course of employment.
For risk, protection and security purposes, we may monitor e-mails and
take appropriate action.
Company Registration Number - 1763490 VAT Number: 386 1191 40
Place of Registration - 3rd Floor, Marlborough House, 179-189 Finchley
Road, London, NW3 United Kingdom
Registered Office Address - Mermaid House, 2 Puddle Dock, London, EC4V
3DS
Visit us online Business Monitor Int'l <http://www.businessmonitor.com/>
or contact us via email [email protected]
________________________________
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general