AnsweredAssumed Answered

XML - Handling a Title section differently depending on where it exists within the XML advert

Question asked by goodhope on Nov 30, 2009
Latest reply on Dec 4, 2009 by comment_1

Title

XML - Handling a Title section differently depending on where it exists within the XML advert

Post

Hello,

 

Still on the XML mission - thanks to those that given me assistance.

 

I now have another issue - I have a tag in my XML file called <Title>. This can appear as a true title near the top of a particular advert (if you remember the XML file is a collection of separate adverts for a newspaper), or further down between textual paragraphs. What I need to do is differentiate between the two - I think somehow with an 'if' statement. Please see example XML advert below.

 

I'd like when imported into Filemaker to put the Title at the head of the notice (<Title>NOTICE OF RECOMMENDED CASH OFFER</Title>) into one field, then treat the other titles (<Title>RECOMMENDED CASH OFFER</Title> and <Title>LOGIC CORPORATION</Title>) as normal Text, and run these plus the <text> paragraphs into another field (I guess what I'm saying is somehow convert those 'titles' within the textual area of the advert to 'text' paragraphs using my XSLT). To me the keying does not look correct, but this is legacy data that I have to try to work with.

 

XML SAMPLE NOTICE:

 

<Notice Type="2301" Reference="654421">

<Metadata>

<PublishDate>2008-08-20</PublishDate>

<SupplierNoticeID>33496</SupplierNoticeID>

</Metadata>

<Title>NOTICE OF RECOMMENDED CASH OFFER</Title>

<P>

<Text>Publication Date: 24 August 2009</Text>

</P>

<P>

<Text>Notice Code: [432>]</Text>

</P>

<Title>RECOMMENDED CASH OFFER</Title>

<P>

<Text>by</Text>

</P>

<Title>LOGIC CORPORATION</Title>

<P>

<Text>The terms defined in the Offer Document have the same meaning in this notice.</Text>

</P>

<P>

<Text>This notice does not constitute, and must not be construed as an offer. ARC Shareholders who accept the Offer may rely only on the Offer Document and, in the case of ARC Shareholders holding ARC Shares in certificated form, the Form of Acceptance for all the terms and conditions of the Offer.</Text>

</P>

<Administration>

<Administrator>Logic</Administrator>

<DateSigned Date="2009-08-24">21 August 2008</DateSigned>

</Administration>

</Notice>

 

 

XSLT EXAMPLE (showing how I currently have the 'Title' and 'Text' being handled):

 

<ROW MODID="" RECORDID="">

 

<COL><DATA><xsl:for-each select="Title">

<xsl:value-of select="." /><xsl:text>&#10;&#13;</xsl:text>

</xsl:for-each></DATA></COL> 

 

<COL><DATA><xsl:for-each select="P/Text">

<xsl:value-of select="." /><xsl:text>&#10;&#13;</xsl:text>

</xsl:for-each></DATA></COL> 

 

</ROW> 

Outcomes