need help with foreach and valueof in it

Dec 11, 2010 at 1:28 PM

Hi,

I need some help with setting up xpath in the template.

xml:

<DodaciListExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DodList>
26/08/2010
</DodList>
<Date>
11. 12. 2010
</Date>
<ListDetails>
<DodaciListDetailExport>
<CisObj>
123456
</CisObj>
<PocetKs>
320
</PocetKs>
<Jedn>
ks
</Jedn>
<Artikel>
32511
</Artikel>
<ArtikelCely>
Solder 10,2, CD000785
</ArtikelCely>
</DodaciListDetailExport>
<DodaciListDetailExport>
<CisObj>
123456
</CisObj>
<PocetKs>
220
</PocetKs>
<Jedn>
ks
</Jedn>
<Artikel>
32546
</Artikel>
<ArtikelCely>
ISO G ½“ A INT, CD000795
</ArtikelCely>
</DodaciListDetailExport>
<DodaciListDetailExport>
<CisObj>
123456
</CisObj>
<PocetKs>
540
</PocetKs>
<Jedn>
ks
</Jedn>
<Artikel>
32835
</Artikel>
<ArtikelCely>
ISO G ¾“&Solder 16, CD000859
</ArtikelCely>
</DodaciListDetailExport>
</ListDetails>
</DodaciListExport>

i have set foreach (xpath-> /d:DodaciListExport/d:ListDetails/d:DodaciListDetailExport ) and tried also (xpath-> /d:DodaciListExport/d:ListDetails)  for table row and put path valueof in column  of each 3 columns (valueof -> d:PocetKs)

(valueof -> d:Jedn) (valueof -> d:CisObj)

Something is wrong, but i don`t know what is it as im getting exception

System.Exception was unhandled by user code
Message=ValueOf: Error evaluating a nodeset using xpath: ''. Details: System.Xml.XPath.XPathException: Expression must evaluate to a node-set.
at MS.Internal.Xml.XPath.XPathParser.ParseNodeTest(AstNode qyInput, AxisType axisType, XPathNodeType nodeType)
at MS.Internal.Xml.XPath.XPathParser.ParseStep(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseRelativeLocationPath(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseLocationPath(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParsePathExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseUnionExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseUnaryExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseMultiplicativeExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseAdditiveExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseRelationalExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseEqualityExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseAndExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseOrExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseXPathExpresion(String xpathExpresion)
at System.Xml.XPath.XPathExpression.Compile(String xpath, IXmlNamespaceResolver nsResolver)
at System.Xml.XPath.XPathNavigator.Compile(String xpath)
at fleXdoc.Api.XsltExtensions.Evaluate(XPathNodeIterator context, String expression, String nsPrefix, String nsURI, String sourceName) in D:\VisualStudio\Proj\FlexDoc\flexdoc\Api\XsltExtensions.cs:line 103
Source=fleXdoc.Api
StackTrace:
at fleXdoc.Api.XsltExtensions.Evaluate(XPathNodeIterator context, String expression, String nsPrefix, String nsURI, String sourceName) in D:\VisualStudio\Proj\FlexDoc\flexdoc\Api\XsltExtensions.cs:line 152
InnerException:

Can someone point to the right way?

thank you

Coordinator
Dec 11, 2010 at 1:54 PM

Enable logging, it may help you. Check the web.config of the webservice for instructions.

Dec 11, 2010 at 2:08 PM

I think problem is in declared xpaths of valueof, i don`t know if its all right :/, i`m using only Api, and not webservice, as i`m developing only for client. I am playing with it for several hours and i am bit sick of it :((((.

Dec 11, 2010 at 3:11 PM

Sorry, it was my fault. I had blank valueof in my document template and path is required :/ Thank you for your immediate help Robert.

Coordinator
Jul 23, 2013 at 6:38 PM
Come check out the successor of fleXdoc: Docati!
It supports Word 2010 and 2013 as well and runs in the cloud.

I sure hope to welcome you as a Docati user as well! :-)

http://www.docati.com