two quick questions

T

tascienu

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...
 
R

Richard Tobin

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: said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,839
Latest member
MartinaBur

Latest Threads

Top