Search Results

Search found 8 results on 1 pages for 'iheartgreek'.

Page 1/1 | 1 

  • Dynamically generate XPath expression using XML data

    - by iHeartGreek
    Hi! I would like to dynamically create XPath expressions in an XSL determined by data in an XML file. (i.e. the XML data is "concatenated" to create an XPath expression). Example of XML data: AAA BBB CCC Example of how I would like the XPath expression to look like: //AAA | //BBB | //CCC And this dynamic generation needs to be done in an XSL file. I am fairly new to XSL (and family) and would appreciate some general direction on how to tackle this problem. Thanks!

    Read the article

  • using XSL to replace XML nodes with new nodes

    - by iHeartGreek
    I need an XSL solution to replace XML nodes with new nodes. Say I have the following existing XML structure: <root> <criteria> <criterion>AAA</criterion> </criteria> </root> And I want to replace the one criterion node with: <criterion>BBB</criterion> <criterion>CCC</criterion> <criterion>DDD</criterion> So that the final XML result is: <root> <criteria> <criterion>BBB</criterion> <criterion>CCC</criterion> <criterion>DDD</criterion> </criteria> </root> I have tried using substring-before and substring-after to just copy the first half of the structure, then just copy the second half (in order to fill in my new nodes in between the two halves) but it appears that the substring functions only recognize text in between the nodes' tags, and not the tags themselves like I want them to. :( :( Any other solutions?

    Read the article

  • Link XSL Style Sheet to XForms generated XML document

    - by iHeartGreek
    Hi! Through XForms, I generate an XML document. I need this XML document to be transformed by a specific XSL. How do I link the XSL to the XML through XForms? Example of link: <?xml-stylesheet type="text/xsl" href="test.xsl"?> (The XML doc gets regenerated every time the XForms submits to it.. so I cannot hardcode the link in the XML doc, in needs to be done through the XForms) Thanks!

    Read the article

  • error message The URI does not identify an external Java class

    - by iHeartGreek
    Hi! I am new to XSL, and thus new to using scripts within the XSL. I have taken example code (also using C#) and adapted it for my own use.. but it does not work. The error message is: The URI urn:cs-scripts does not identify an external Java class The relevant code I have is: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns:strTok="urn:cs-scripts"> ... ... ... </xsl:template> <xsl:variable name="temp"> <xsl:value-of select="tok:getList('AAA BBB CCC', ' ')"/> </xsl:variable> <msxsl:script language="C#" implements-prefix="tok"> <![CDATA[ public string[] getList(string str, char[] delim) { return str.Split(delim, StringSplitOptions.None); } public string getString(string[] list, int i) { return list[i]; } ]]> </msxsl:script> </xsl:stylesheet>

    Read the article

  • Possible to set two values for two different nodes from user input in XForms?

    - by iHeartGreek
    Hi! I would like to set two values for two different nodes from user input in XForms. I am curious about how this is done, if at all possible. For example, if I have the following data model: <xf:instance id="criteria_data" xmlns=""> <criteria> <set> <root></root> <criterion></criterion> </set> </criteria> </xf:instance> <xf:instance id="choices" xmlns=""> <choices> <root label="The Choices">/AAA</root> <choice label="BBB">/@BBB</choice> </choices> </xf:instance> <xf:instance id="choices" xmlns=""> <choices> <root>/AAA</root> <choice label="BBB">/@BBB</choice> <choice label="CCC">/@CCC</choice> <choices> </xf:instance> <xf:bind id="data_criterion" nodeset="instance('criteria_data')/criteria/set/criterion"/> <xf:bind id="data_root" nodeset="instance('criteria_data')/criteria/set/root"/> <xf:bind id="choices_root" nodeset="instance('choices')/root"/> <xf:bind id="choices" nodeset="instance('choices')/choice"/> and my ui code looks like: <xf:select bind="data_criterion" appearance="full"> <xf:label>Your choices:</xf:label> <xf:itemset bind="choices"> <xf:label ref="@label"></xf:label> <xf:value ref="."></xf:value> </xf:itemset> </xf:select> But I essentially want it to be like this (though this is invalid and does not produce any xml at all): <xf:select appearance="full"> <xf:label>Your choices:</xf:label> <xf:itemset bind="choices"> <xf:label ref="@label"></xf:label> <xf:value bind="data_criterion" ref="."></xf:value> <xf:value bind="data_root" ref="instance('choices')/root"></xf:value> </xf:itemset> </xf:select> The XML output I want to achieve (if user checks "BBB"): <criteria> <set> <root>/AAA</root> <criterion>/@BBB</criterion> </set> </criteria> How can I achieve setting these two nodes for the one checkbox seletion? Hope that all made sense... Thanks! :)

    Read the article

  • Can XPath concatenate two nodeset values? (for use in XForms)

    - by iHeartGreek
    Hi! I am wanting to concatenate two nodeset values using XPath in XForms. I know that XPath has a concat(string, string) function, but how would I go about concatenating two nodeset values? BEGIN EDIT: I tried concat function.. I tried this.. and variations of it to make it work, but it doesn't <xf:value ref="concat(instance('param_choices')/choice/root, .)"/> END EDIT Below is a simplified code example of what I am trying to achieve. XForms model: <xf:instance id="param_choices" xmlns=""> <choices> <root label="Param Choices">/param</root> <choice label="Name">/@AAA</choice> <choice label="Value">/@BBB</choice> </choices> </xf:instance> XForms ui code that I currently have: <xf:select ref="instance('criteria_data')/criteria/criterion" appearance="full"> <xf:label>Param choices:</xf:label> <br/> <xf:itemset nodeset="instance('param_choices')/choice"> <xf:label ref="@label"></xf:label> <xf:value ref="."></xf:value> </xf:itemset> </xf:select> (if user selects "Name" checkbox..) the XML output is: <criterion>/@BBB</criterion> However! I want to combine the root nodeset value with the current choice nodeset value. Essentially: <xf:value ref="(instance('definition_choices')/choice/root) + ."/> to achieve the following XML output: <criterion>/param/@BBB</criterion> Any suggestions on how to do this? (I am fairly new to XPath and XForms) p.s. what I am asking makes sense to me when I typed it out, but if you have trouble figuring out what I'm asking, just let me know.. thanks!

    Read the article

  • Error message in XSLT with C# extension function

    - by iHeartGreek
    Hi! I am received the following error while trying to implement a C# extension function in XSLT. Extension function parameters or return values which have CLR type 'Char[]' are not supported.** code: <xsl:variable name="stringList"> <xsl:value-of select="extension:GetList('AAA BBB CCC', ' ')"/> </xsl:variable> <msxsl:script language="C#" implements-prefix="extension"> <![CDATA[ public string[] GetList(string str, char[] delimiter) { ... ... return str.Split(delimiter, StringSplitOptions.None); } ]]> </msxsl:script> Can someone explain this error message and how to get past it? Thanks!

    Read the article

  • XForms and multiple inputs for same model tag

    - by iHeartGreek
    Hi! I apologize ahead of time if I am not asking this properly.. it is hard to put into words what I am asking.. I have XForms model such as: <file> <criteria> <criterion></criterion> </criteria> </file> I want to have multiple input text boxes that create a new criterion tag. user interface such as: <xf:input ref="/file/criteria/criterion" model="select_data"> <xf:label>Select</xf:label> </xf:input> <xf:input ref="/file/criteria/criterion" model="select_data"> <xf:label>Select</xf:label> </xf:input> <xf:input ref="/file/criteria/criterion" model="select_data"> <xf:label>Select</xf:label> </xf:input> And I would like the XML output to look like this (once user has entered in info): <file> <criteria> <criterion>AAA</criterion> <criterion>BBB</criterion> <criterion>CCC</criterion> </criteria> </file> The way I have it doesn't work, as it sees the 3 input fields to be referring all to the same criterion tag. How do I differentiate? Thanks! I hope that made some sense! BEGIN FIRST EDIT Thanks for the responses for the basic text box! However, I now need to do this with a listbox. But for the life of me, I can't figure out how. I read somewhere to use with the xforms:select and deselect events.. but I didn't know where to place them, and the places I tried gave me very weird behaviour. I am currently implementing the following: <xf:select ref="instance('criteria_data')/criteria/criterion" selection="" appearance="compact" > <xf:label>Choose criteria</xf:label> <xf:itemset nodeset="instance('criteria_choices')/choice"> <xf:label ref="@label"></xf:label> <xf:value ref="."></xf:value> </xf:itemset> </xf:select> However when multiple choices are submitted, all selection values are inserted into the same node, separated by spaces. For example: If AAA and BBB and FFF were selected from listbox, it would result in the following XML: <criterion>AAA BBB FFF</criterion> How do I change my code to have each selection be in a separate node? i.e. I want it to look like this: <criterion>AAA</criterion> <criterion>BBB</criterion> <criterion>FFF</criterion> Thanks! END FIRST EDIT BEGIN SECOND EDIT: For the listboxes (ie xf:select appearance="compact") I ended up allowing the spaces to occur in the same node and then just transformed that xml using xsl to generate a properly formatted new xml doc (with separate individual nodes). Unfortunately, I did not find a less cumbersome solution by inserting them originally into separate nodes. The selected answer works very well for text boxes however, hence why I selected it as the answer. END SECOND EDIT

    Read the article

1