Goh, Swee-Doon (GPMS) wrote:
> 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.
>
If the value returned by command pick contains whitespace:
---
<command name="putAttribute" parameter="role %_"/>
---
cannot work.
See the number of arguments in
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/putAttribute.html
You need to specify:
---
<command name="putAttribute" parameter="role '%_'"/>
---
I don't see anything else. And there are no known bugs related to the
functions you use (which are used quite often in our product).
---
PS: The following lines are not useful:
---
<set variable="metadata" expression="%_" plainString="true"/>
<get expression="$metadata"/>
---