www.webdeveloper.com
Results 1 to 6 of 6

Thread: new to xml...urls problem

  1. #1
    Join Date
    Nov 2005
    Posts
    3

    Question new to xml...urls problem

    I'm just sitting at home trying to teach myself xml so i'd appreciate some help

    I have this xml from a search engine

    <result href="http://blahblah.htm">
    <title>blah</title>
    <score>69%</score>
    <size>38.5K</size>
    <summary>yadda yadda yadda</summary>
    </result>

    My problem is in getting the url out of the result tag........any suggestions

    Thanks in advance

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Cut and paste? What exactly are you up to?
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Nov 2005
    Posts
    3
    Thanks

    im trying to build a nice interface for a search engine, one with no accessibility issues.

    its the xsl i am interested in so an href tag can be built with the correct url in it for each search hit.

  4. #4
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Code:
    <xsl:template match="result@href">
      <a>
        <xsl:attribute name="href">
          <xsl:value-of select="@href"/>
        </xsl:attribute>
        <xsl:apply-template select="title"/>
      </a>
    </xsl:template>
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  5. #5
    Join Date
    Nov 2005
    Posts
    3
    thanks charlie

    it was the @ character that I was missing, that enables us to look at the href part of the tag i presume?

  6. #6
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    It's Charles. And the amphora indicates an attribute.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles