Hi Hussein,
Do you see a problem with this? When I try to run it from the command interface
it seems to run successfully, but returns nothing. When I try to run "join"
from the command interface I get a "cannot execute" message. The Xpath is
valid; it returns the expected results when run with the xpathSearch command.
The problem is something to do with Get or Join...I think.
in the XXE:
<command
<getexpression="join(//ns:states/ns:state, ' ')"/>
<commandname="pick"parameter="'Choose state:' false %_"/>
<setvariable="name"expression="%_"plainString="true"/>
<commandname="putAttribute"parameter="name '%_'"/>
</sequence>
</macro>
</command>
?
?
In the CSS:
?
signal > state:before {
content: command-button(icon, icon(pop-right),
command, "fetchStateNames"
)
}
name="fetchStateNames">
<macroundoable="true"repeatable="true">
<sequence>
----- Original Message ----
> From: Hussein Shafie <hussein at xmlmind.com>
> To: Jeff Hooker <jeff at itwriting.ca>
> Cc: "xmleditor-support at xmlmind.com" <xmleditor-support at xmlmind.com>
> Sent: Fri, December 4, 2009 1:09:16 AM
> Subject: Re: [XXE] CSS support for populating attribute values
>
> Jeff Hooker wrote:
> >
> > I'm building a css interface for an IP-XACT schema. As a part of the
> > schema,
> users define STATE elements in one part of an XML file and then reuse the
> values
> of the STATE elements as attribute values in another part of the file. I can
> use
> XML Schema keyref function to validate the dynamic content (STATE names) but
> they're still having to type the state names in manually, which is error
> prone.
> >
> > Is there any way of using CSS + XMLmind's xpath command to populate a
> drop-down list with content generated from an XML file?
> >
>
> Yes.
>
> [1] Write a macro-command which:
>
> [a] Invokes <:get>to collect the STATE values.
> See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/xpath_get.html
>
> Use XPath extension function join() to join the collected values using a
> space character:
> See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/xpathextfunc.html
>
> [b] Invokes command pick to let the user choose a value.
> See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/pick.html
>
> [c] Invokes command putAttribute to add or change the attribute value.
> See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/putAttribute.html
>
> [2] Modify your CSS to embed command-buttons in the styled document
> view. Such command-buttons invoke the above macro.
>
> See
> http://www.xmlmind.com/xmleditor/_distrib/doc/csssupport/command-button.html