Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mapping the Content control in an XSL

Status
Not open for further replies.

KG0102

Technical User
Oct 15, 2007
5
How to map the content under <w:sdtcontent> tag in an xsl:

Have a look at the content control code in xml:

<w:sdt>
<w:sdtPr>
<w:alias w:val="Last Name" />
<w:tag w:val="LastName" />
<w:dataBinding w:prefixMappings="xmlns:ns0=' …healthcare/registrationform'"
w:xpath="/ns0:Data/ns0:patient/ns0:Name/ns0:Last"
w:storeItemID="{A5566E5B-6220-4F8C-BB50-CB2E486681CB}" />
<w:text />
</w:sdtPr>
<w:sdtContent>
<w:r>
<w:t>Predeek</w:t>
</w:r>
</w:sdtContent>
</w:sdt>


Regards,
KG0102
 
>How to map the content under <w:sdtcontent> tag in an xsl:
What is special about it?
 
Tsuji,
the code snippet appears after we introduce a content control in a word document and the content control is introduced for a selected text within a tag i.e <demo-text> with several demo text tags at same level but I want to pick only the text under the content control in a particular tag and discard all other.
 
Why the quote to the original where those lines are coming from is missing?
That makes people understand the background unless you are capable of doing a good shorter exposition of the context. Furthermore, I wonder how those people writing that article think? All in all, why withheld that info? to make our life more difficult?
 
Hi tsuji,
The intention was not to make life difficult for you or hiding the context,the reason was that I was using the very similar code for adding content controls but could not divulge the actual code therefore searched a very similar code.
However I found the solution for it:
<xsl:if test="//w:customXml[@w:element='abcd']/w:customXml[@w:element='efgh']//w:customXml[@w:element='hijk']//w:sdt//w:tag[@w:val='LastName'] ">
<xsl:element name="sdf">
<xsl:attribute name="value">
<xsl:value-of select="//w:sdt[.//w:tag[@w:val='LastName']]"/>
</xsl:attribute>
</xsl:element>
</xsl:if>

The real issue was that there were several content control
within a tag and it was solved using the tag name.

Anyway thanks for all the help!

Regards,
KG10
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top