Hi, I found the instruction to do the dynamic values. I made it work by picking
up the values from a URL. However, I'm not able to assign it to the attribute.
I used the "alert" to test the value and it returns the string value depending
what I select. So I know the "%_" is passed with correct string value.
Once I removed the alert test command, and use the "putAttribute", the value
cannot be passed over. If I put a static string (parameter="role
static_string"/>), it works fine.
Am I missing something obvious here? The RelaxNG schema is defined as
cng.section.role.attribute |= attribute role { text }
Below is my command definition:
<command name="subjectMetadata">
<macro undoable="true">
<sequence>
<command name="selectNode"
parameter="self[implicitElement] {http://www.myco.com/schema}section" />
<command name="pick" parameter="'Subject Metadata' true
@ http://cabelsgoh-l1/www/test_files/metadata.txt default"/>
<set variable="metadata" expression="%_"
plainString="true"/>
<get expression="$metadata"/>
<!--command name="alert" parameter="%_"/-->
<command name="putAttribute" parameter="role %_"/>
</sequence>
</macro>
</command>
Please let me know if I'm missing some important details. Thanks for your time.
Swee-Doon
________________________________
From: Goh, Swee-Doon (GPMS)
Sent: Tuesday, December 08, 2009 5:49 PM
To: 'xmleditor-support at xmlmind.com'
Subject: Dynamic 'pick' value for command
Hi,
I'm trying to create a command to prompt the user to select the dynamic values.
The values could be pulled from another xml file, or through the REST result.
I managed to create the pick list for static value. See code below:
<button toolTip="Subject Metadata"
icon="../config/common/icons/plainText.png">
<command name="subjectMetadata">
<macro undoable="true">
<sequence>
<command name="pick"
parameter="'Subject Metadata' true
'Metadata 1'
'meta value 1'
'Metadata 2'
'meta value 2'
'Metadata 3'
'meta value 3'"/>
<set variable="url"
expression="%_" plainString="true"/>
<command name="insert"
parameter="into ulink"/>
<get expression="$url"/>
<command name="putAttribute"
parameter="url %_"/>
<get expression="$url"/>
<command name="insertString"
parameter="%_"/>
</sequence>
</macro>
</command>
</button>
Is it possible to generate the dynamic value for user to choose? If not, what
option do I have to achieve the similar function? The other closest feature I
can think of is similar to the spell check where the list of values are
certainly dynamic.
Thank you for your help.
Swee-Doon Goh
Sr. Transformation Engineer, GPMS
Cengage Learning
20 Davis Drive,
Belmont, CA 94002
(0) 650.637.7616 | swee-doon.goh at cengage.com<mailto:swee-doon.goh at
cengage.com> | www.cengage.com<http://www.cengage.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20091209/92c64534/attachment-0001.htm