Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need Help in writing img files to xml !!!

    hi all, how do i insert image files from a file field and write to the xml file itself... is the coding done thru asp, or html or xsl file?? i really need help badly ...thks....

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Newcastle, England
    Posts
    178
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can include a <picture> or <image> element (or whatever name you choose) within your xml file, give it the appropriate href attribute, and then transform this into an <img> tag using an xsl stylesheet.

    patrick

  • #3
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,459
    Thanks
    1
    Thanked 23 Times in 21 Posts
    mjpbrennan's answer is probably the best you're going to get. XML languages are typically intended to convey text-based data, and images really don't fit well.

    There are alternatives, though:

    <img xmlns="http://www.w3.org/1999/xhtml" src="whatever.jpg" />

    If the client browser is configured to recognize namespaces in an XML document, this should force the browser to retrieve the image.

    Another option is the SVG language, which is a markup language describing an image by vectors. It's not good for photography, but for simple diagrams it's plenty.

    HTH
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #4
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    You can also use XLink to tell the viewer to embed the data at the value of xlink:href into the page, which could be an image...

  • #5
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,459
    Thanks
    1
    Thanked 23 Times in 21 Posts
    XLink support is spotty even in Mozilla...
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #6
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by Alex Vincent
    XLink support is spotty even in Mozilla...
    xlink:type="simple" works very well in Moz. I don't think any other web browser though even supports any XLink...

  • #7
    New Coder
    Join Date
    Sep 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    browsing for an image file and store it in the xml file ??

    hi all, what i mean is to get an image from a file field and write the image to the xml file without hardcoding it in the xml file initially.... how to do that?
    eg. its juz like browsing for an image file and store it in the xml file and i will like to display the img according to different xsl stylesheets

  • #8
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,459
    Thanks
    1
    Thanked 23 Times in 21 Posts
    Ack, that's something totally different. Your best bet is to pick a technology (probably server-side, like Perl or PHP) to receive a form submission of some sort.

    I have no idea how you'd do that.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog


  •  

    Posting Permissions

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