Welcome!

Artificial Intelligence Authors: Pat Romanski, Yeshim Deniz, Liz McMillan, Elizabeth White, Zakia Bouachraoui

RSS Feed Item

Re: XSLT Stylesheet Exclude Parental Search Results?

Just replace test="" by select="".

2009/1/23 Jack Bush <[email protected]>

Hi David,

 

Thank you for responding with such detail and enthusiasm.

 

Your suggestion make sense but I still encountered some error messages that needed further guidance with.

 

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:ns="http://www.w3.org/1999/xhtml"

exclude-result-prefixes="ns">

<xsl:template match="/">

<area>

<xsl:for-each test="/ns:html/ns:body/ns:div[@id='content']/ns:p/ns:strong">

<xsl:choose>

<xsl:when test="contains(.,'Firstname:')">

<firstname><xsl:value-of select="."/></firstname>

</xsl:when>

<xsl:otherwise>

<firstname>Unknown</firstname>

</xsl:otherwise>

</xsl:choose>

</xsl:for-each>>

</area>

</xsl:template>

</xsl:stylesheet>

 

XSLT Transformation output returned:

Error at xsl:for-each on line 10 of file:/C:/Documents and Settings/Jack/TestApplications/:

Attribute test is not allowed on this element

Error at xsl:for-each on line 10 of file:/C:/Documents and Settings/Jack/TestApplications/:

Element must have a "select" attribute

 

Any further suggestion would be appreciated.

Thanks again,

Jack




From: David Carlisle <[email protected]>
To: [email protected]
Cc: [email protected]
Sent: Friday, 23 January, 2009 12:07:45 AM
Subject: Re: XSLT Stylesheet Exclude Parental Search Results?



<xsl:template match="/">
so the cntext here is the root of the document, ie the parent of the
html element.

<xsl:when test="contains(.,'Firstname:')">

so . here is the whole document and you are taking its string value,
which is all the character data in the document, ignoring all element
markup.  So if the file, anywhere contains the string 'Firstname:' and
it also has an element matching
/ns:html/ns:body/ns:div[@id='content']/ns:p/ns:strong"
then you do <xsl:value-of select="."/> which is the string value of teh
whole document.

a) you probably want to as on xsl-list rather than here and b) you want

somthing like


<xsl:for-each test="/ns:html/ns:body/ns:div[@id='content']/ns:p/ns:strong">
<xsl:choose>
<xsl:when test="contains(.,'Firstname:')">
<firstname><xsl:value-of select="."/></firstname>
</xsl:when>

so you are testing the strong element and outputting its content, not
testing the whole document.

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________


Stay connected to the people that matter most with a smarter inbox. http://au..rd.yahoo.com/galaxy/mail/tagline2/*http://au.docs.yahoo.com/mail/smarterinbox.

Read the original blog entry...

IoT & Smart Cities Stories
BMC has unmatched experience in IT management, supporting 92 of the Forbes Global 100, and earning recognition as an ITSM Gartner Magic Quadrant Leader for five years running. Our solutions offer speed, agility, and efficiency to tackle business challenges in the areas of service management, automation, operations, and the mainframe.
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
After years of investments and acquisitions, CloudBlue was created with the goal of building the world's only hyperscale digital platform with an increasingly infinite ecosystem and proven go-to-market services. The result? An unmatched platform that helps customers streamline cloud operations, save time and money, and revolutionize their businesses overnight. Today, the platform operates in more than 45 countries and powers more than 200 of the world's largest cloud marketplaces, managing mo...
The platform combines the strengths of Singtel's extensive, intelligent network capabilities with Microsoft's cloud expertise to create a unique solution that sets new standards for IoT applications," said Mr Diomedes Kastanis, Head of IoT at Singtel. "Our solution provides speed, transparency and flexibility, paving the way for a more pervasive use of IoT to accelerate enterprises' digitalisation efforts. AI-powered intelligent connectivity over Microsoft Azure will be the fastest connected pat...
Apptio fuels digital business transformation. Technology leaders use Apptio's machine learning to analyze and plan their technology spend so they can invest in products that increase the speed of business and deliver innovation. With Apptio, they translate raw costs, utilization, and billing data into business-centric views that help their organization optimize spending, plan strategically, and drive digital strategy that funds growth of the business. Technology leaders can gather instant recomm...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
As you know, enterprise IT conversation over the past year have often centered upon the open-source Kubernetes container orchestration system. In fact, Kubernetes has emerged as the key technology -- and even primary platform -- of cloud migrations for a wide variety of organizations. Kubernetes is critical to forward-looking enterprises that continue to push their IT infrastructures toward maximum functionality, scalability, and flexibility. As they do so, IT professionals are also embr...
CloudEXPO has been the M&A capital for Cloud companies for more than a decade with memorable acquisition news stories which came out of CloudEXPO expo floor. DevOpsSUMMIT New York faculty member Greg Bledsoe shared his views on IBM's Red Hat acquisition live from NASDAQ floor. Acquisition news was announced during CloudEXPO New York which took place November 12-13, 2019 in New York City.
In an age of borderless networks, security for the cloud and security for the corporate network can no longer be separated. Security teams are now presented with the challenge of monitoring and controlling access to these cloud environments, at the same time that developers quickly spin up new cloud instances and executives push forwards new initiatives. The vulnerabilities created by migration to the cloud, such as misconfigurations and compromised credentials, require that security teams t...
The graph represents a network of 1,329 Twitter users whose recent tweets contained "#DevOps", or who were replied to or mentioned in those tweets, taken from a data set limited to a maximum of 18,000 tweets. The network was obtained from Twitter on Thursday, 10 January 2019 at 23:50 UTC. The tweets in the network were tweeted over the 7-hour, 6-minute period from Thursday, 10 January 2019 at 16:29 UTC to Thursday, 10 January 2019 at 23:36 UTC. Additional tweets that were mentioned in this...