|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Really basic, but can't get it to work, and it's g
Daniel >OK, > >here's one for the beginners; > >I've got the following XML <slightly modified> > ><ScripCommsMessage xmlns="http://www.computershare.com/scripcomms/v1.0"> > <HostSlot>1479</HostSlot> > <SearchForHolderResponse> > <Result>0</Result> > <NoOfItems>10</NoOfItems> > <FirstRecordHandle>A10A000002000100</FirstRecordHandle> > <RecordHandle>880A000002000100</RecordHandle> > <Items> > <Item id="1"> > <HIN>C0072995945</HIN> > <PostCode>M60 1AA</PostCode> > <NameAddress1>SMITH & >WILLIAMSON NOMINEES</NameAddress1> > <NameAddress2><A/C >A164>,</NameAddress2> > <NameAddress3>12 POINT STREET</NameAddress3> > <NameAddress4>SPITTAL ESTATE</NameAddress4> > <NameAddress5>SANDLODGE</NameAddress5> > <NameAddress6>MANCHESTER</NameAddress6> > <NameAddress7/> > </Item> > </Items> > </SearchForHolderResponse> ></ScripCommsMessage> > > >And this is the start of my XSL: > ><xsl:stylesheet version="1.0" >xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> ><xsl:include href="CommonFunctions.xsl" /> ><xsl:output method="html" /> ><xsl:output indent="yes" /> this should be <xsl:output method="html" indent="yes" /> > ><xsl:template match="/"> this is matching the root not ScripCommsMessage as HostSlot is not a child of the root you get nothing there change it to /ScripCommsMessage > <b><xsl:value-of select="HostSlot" /></b> > <xsl:apply-templates select="/SearchForHolderResponse" /> ></xsl:template> this is saying apply-templates to the top level element SearchForHolderResponse which is not a child of the root you get nothing there remove the leading "/" > ><xsl:template match="SearchForHolderResponse" > this never gets hit because of the above apply-templates > <xsl:value-of select="FirstRecordHandle" /> > <xsl:for-each select="Items/Item"> > <xsl:call-template name="GetTableData" /> > </xsl:for-each> ></xsl:template> ></xsl:stylesheet> Ciao Chris XML/XSL Portal http://www.bayes.co.uk/xml XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








