two quick questions

Discussion in 'XML' started by tascienu@ecoaches.com, Mar 13, 2005.

  1. Guest

    1 - Can an element have some innerText as well as child nodes?
    ie: <myel>some inner text here... <subel/></myel>
    is it allowed?

    2 - I have a file element... <file src="/Images/spacer.gif" />. I want
    to select it...
    myfile.selectSingleNode(File[@src='/Images/spacer.gif'])

    the problem is, on windows, file names can be any case...
    /IMAGES/SPACER.GIF would also be valid, but it would not select that
    node. How do i deal with this?

    Thanks...
    , Mar 13, 2005
    #1
    1. Advertising

  2. In article <>,
    <> wrote:

    >1 - Can an element have some innerText as well as child nodes?
    >ie: <myel>some inner text here... <subel/></myel>
    >is it allowed?


    "innerText" suggests that you are using some system I'm not familiar
    with, but as far as XML is concerned you can certainly mix text and
    elements. Just think of (X)HTML: <p>Some <b>bold</b> text.</p>

    >2 - I have a file element... <file src="/Images/spacer.gif" />. I want
    >to select it...
    >myfile.selectSingleNode(File[@src='/Images/spacer.gif'])
    >
    >the problem is, on windows, file names can be any case...
    >/IMAGES/SPACER.GIF would also be valid, but it would not select that
    >node. How do i deal with this?


    Well, I'd start by not using Windows, but you might also find the
    translate() function useful:

    File[translate(@src, "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
    "abcdefghijklmnopqrstuvwxyz") = '/images/spacer.gif']

    This will not of course work for non-English characters, but you don't
    seem to have any of them.

    -- Richard
    Richard Tobin, Mar 13, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JS

    Two quick questions

    JS, Jan 18, 2006, in forum: Java
    Replies:
    7
    Views:
    341
    Roedy Green
    Jan 18, 2006
  2. Geoff Hague
    Replies:
    5
    Views:
    396
    Mark Parnell
    Jul 15, 2004
  3. Horny Porno-thologist

    Just two quick questions

    Horny Porno-thologist, Jan 27, 2004, in forum: XML
    Replies:
    2
    Views:
    369
    Paul Lee
    Jan 27, 2004
  4. Elaine Jackson

    two quick questions

    Elaine Jackson, Aug 13, 2003, in forum: Python
    Replies:
    7
    Views:
    329
    Elaine Jackson
    Aug 13, 2003
  5. Michele Dondi

    Two quick questions about Perl6

    Michele Dondi, May 28, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    90
    Uri Guttman
    May 30, 2004
Loading...

Share This Page