Beginner needs a little direction.
Home › Forums › WordprocessingML › Beginner needs a little direction.
- This topic has 3 replies, 2 voices, and was last updated 9 years, 5 months ago by
Eric White.
-
AuthorPosts
-
August 25, 2016 at 6:01 pm #3692
Eric White
KeymasterHi Scott,
Very sorry for the slow response – I was on vacation and traveling. I’m back in the saddle again.
Your scenario is very doable using Open XML.
Take a look at the screen-casts for DocumentAssembler:
http://www.ericwhite.com/blog/blog/documentassembler-developer-center/
The approach is that you generate the appropriate XML from your data source, have a template that refers to your newly generated XML, and then you generate your desired document by invoking a single method.
I also recommend watching the screen-cast series on Open XML and WordprocessingML – links in the side bar.
Cheers, Eric
September 5, 2016 at 10:13 pm #3743Scott
ParticipantEric,
Thanks so much for your reply.
I have gone down the DocumentAssembler direction per your suggestion and am having some success.
I am however having a bit of difficulty with repeating content:
I am getting a error “Repeat: Select returned no data” on the code:
<Repeat Select=”./Parties/Role/Plaintiffs/Names”/>
<Content Select=”./Name”/>,
<EndRepeat/>But very similar code in the same document works fine:
<Repeat Select=”./Attorneys/Attorney”/>
<Content Select=”./Name”/>, Atty Reg #: <Content Select=”./RegNum”/>
<EndRepeat/>My XML Data is as follows:
<?xml version=”1.0″ encoding=”utf-8″?>
<!– edited with XMLSpy v2016 rel. 2 sp1 (x64) (http://www.altova.com) by Scott Snodgrass (Relentless Pursuit, LLC) –>
<Affidavit>
<CourtName>DISTRICT COURT, DENVER COUNTY, COLORADO</CourtName>
<CourtStreet>1437 Bannock Street</CourtStreet>
<CourtCity>Denver</CourtCity>
<CourtState>CO</CourtState>
<CourtZip>80202</CourtZip>
<Party1Title>Plaintiff</Party1Title>
<Party2Title>Defendant</Party2Title>
<Plaintiff>John Q Public</Plaintiff>
<Defendant>Son T Do</Defendant>
<Parties>
<Role>
<Plaintiffs>
<Names>
<Name>John Q Public</Name>
</Names>
<Names>
<Name>Suzy Public</Name>
</Names>
</Plaintiffs>
<Defendants>
<Names>
<Name>Son T Do</Name>
</Names>
</Defendants>
</Role>
</Parties>
<CaseNum/>
<AttorneyFor>Plaintiff</AttorneyFor>
<LawFirm>Gaiennie Law Offices, LLC</LawFirm>
<LawFirmStreet>3801 E Florida Ave., Suite 100</LawFirmStreet>
<LawFirmCity>Denver</LawFirmCity>
<LawFirmState>CO</LawFirmState>
<LawFirmZip>80210</LawFirmZip>
<LawFirmPhone>303 455-5030</LawFirmPhone>
<Attorneys>
<Attorney>
<Name>Meredith A Quinlivan</Name>
<RegNum>38016</RegNum>
</Attorney>
<Attorney>
<Name>Gorgy Alhasoon</Name>
<RegNum>47505</RegNum>
</Attorney>
<Attorney>
<Name>Robert R. Harper</Name>
<RegNum>48454</RegNum>
</Attorney>
<Attorney>
<Name>Amy E Gaiennie</Name>
<RegNum>24561</RegNum>
</Attorney>
</Attorneys>
<Server>Scott Snodgrass</Server>
<ServerCompany>Relentless Pursuit, LLC</ServerCompany>
<ServerStreet>3531 S. Logan St. D-411</ServerStreet>
<ServerCity>Englewood</ServerCity>
<ServerState>CO</ServerState>
<ServerZip>80113</ServerZip>
<ServerPhone>(303) 570-6285</ServerPhone>
<ServiceDate>August 20, 2016</ServiceDate>
<ServiceTime>1:55 PM</ServiceTime>
<ServiceCompany/>
<ServiceStreet>9033 E Louisiana Ave</ServiceStreet>
<ServiceCity>Denver</ServiceCity>
<ServiceState>CO</ServiceState>
<ServiceZip>80247</ServiceZip>
<ServiceCounty>Arapahoe</ServiceCounty>
<ServiceDocuments>
<Document>
<DocName>Summons</DocName>
</Document>
<Document>
<DocName>Complaint</DocName>
</Document>
<Document>
<DocName>Civil Cover Sheet</DocName>
</Document>
</ServiceDocuments>
</Affidavit>Any ideas on what is wrong?
September 15, 2016 at 12:50 pm #3793Eric White
KeymasterHi,
Did you get this resolved?
Nothing stands out for me – looks correct.
What I would do in this situation – find the code in DocumentAssembler.cs that evaluates the XPath expression – at that point, you can see the XML that it is querying, you can see the XPath expression, and the results of the query.
-
AuthorPosts
- You must be logged in to reply to this topic.