dbdb Posted September 25, 2008 Share Posted September 25, 2008 My target is to return to root so I could page to another nodes in the XMLLet's say I start the xslt from <X_Coordinate> and <Y_Coordinate> pathes.The problem is that when it finish running over the <X_Coordinate> and <Y_Coordinate> by value-of these elements andI want it to move on to other <Chapter>'s so I could run the templates in any path I want.note that, applying templates works alone on the paths but when I try to combine (not as a template but as an outside iframe for example)on after on it succeed showing only the first thing I run. <Chapter> <OrderID>1221298</OrderID> <Code>2</Code> <ID>BusinessDetails</ID> <DisplayName>business</DisplayName> <UpdateDate>19/02/2008</UpdateDate> <ChapterContent> <Part> <Code>1</Code> <ID>CompanyDetails</ID> <DisplayName>details</DisplayName> <UpdateDate>01/01/0001</UpdateDate> <PartContent> <CompanyDetails> <CompanyNames> <Name>TEVA PHARMACEUTICAL </Name> <EnglishName>TEVA PHARMACEUTICAL INDUSTRIES LTD.</EnglishName> <AkaEnglishName /> <AdditionalName /> <AdditionalEnglishName /> </CompanyNames> <Regis>52-001395-4</Regis> <Duns>600029649</Duns> <Phones> <Phone> <Type>Phone</Type> <PhoneNumber>03-9267267</PhoneNumber> </Phone> <Phone> <Type>Phone</Type> <PhoneNumber>03-5892840</PhoneNumber> </Phone> <Phone> <Type>Phone</Type> <PhoneNumber>02-9411717</PhoneNumber> </Phone> <Phone> <Type>Fax</Type> <PhoneNumber>03-9234050</PhoneNumber> </Phone> </Phones> <Address> <City>Ryy</City> <Street>beach 5</Street> <StreetNumber /> <ZIP>49510</ZIP> <POB>3190</POB> <POBCity>Ryy</POBCity> <POB_Zip>49131</POB_Zip> <X_Coordinate>187633</X_Coordinate> <Y_Coordinate>667275</Y_Coordinate> </Address> <WebAddress> <Url>www.tevapharm.com</Url> <Email /> </WebAddress> </CompanyDetails> </PartContent> </Part>........there are several chapters .... thanks for replys Link to comment Share on other sites More sharing options...
boen_robot Posted September 26, 2008 Share Posted September 26, 2008 It appears you are thinking too procedurally. XSLT is functional.If you can, try to make it so that you have one template to handle all <Chapter> elements, one to handle all <X_Coordinate>, etc.In each other template, make an apply-templates call, and leave it like that. As soon as the element it matched, it will get processed.e.g. <xsl:template match="Chapter">Things to do for each chapter...<xsl:apply-templates /><!--Apply inner templates-->Things to do on each chapter after the processing of inner elements is done</xsl:template> and of course, don't forget <xsl:template match="/">Things to do at the start of the processing<xsl:apply-templates />Things to do at the end of the processing</xsl:template> I don't see how the scenario you describe doesn't fit this concept. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.