[xsl] Need Attributes From A InputStream

Subject: [xsl] Need Attributes From A InputStream
From: "Scott Purcell" <spurcell@xxxxxxxxxxxxx>
Date: Thu, 17 Oct 2002 13:01:13 -0500

I am receiving a InputStream which is a XML file. In the xml file there are some attributes I want to grab, to put into a DB.
I did not want to write the XML to File and parse it from there. I would like to parse the inputstream, grab some attributes I need and move along.

I do not know if I should create a DOM Object, and work through it, or use a SAX Parser (and if so, which one?).

Could someone possibly assist me in a direction for this. Below is the XML (I wrote it to disk) that I will receive via the InputStream.

I would like to grab the "width", "height", "copyright" and "colorSpace", "transparency", "ditherAlgorithm" which come from two differrent elements.

<?xml version="1.0" encoding="UTF-8"?>
  <psd width="288" height="288" copyright="" colorSpace="RGB">
      <GIFFormat rolloverMasterPalette="false" autoReduce="false" interlaced="false" transparency="false" reductionAlgorithm="selective" webShiftPercent="0" ditherPercent="100" ditherAlgorithm="diffusion" noMatteColor="false" matteColor="#FFFFFF" lossy="0" numColors="256" />
    <layer name="Black" type="pixel" top="167" left="164" right="265" bottom="267" />
    <layer name="White" type="pixel" top="146" left="143" right="244" bottom="246" />
    <layer name="Purple" type="pixel" top="124" left="120" right="221" bottom="225" />
    <layer name="Price" type="pixel" top="18" left="14" right="265" bottom="74" />
    <layer name="Blue" type="pixel" top="84" left="83" right="211" bottom="206" />
    <layer name="Green" type="pixel" top="74" left="70" right="170" bottom="175" />
    <layer name="Yellow" type="pixel" top="49" left="42" right="143" bottom="150" />
    <layer name="Red" type="pixel" top="22" left="18" right="119" bottom="123" />
    <layer name="Gray" type="pixel" top="0" left="0" right="288" bottom="288" />

Scott Purcell | Developer | VERTIS | 555 Washington Ave. 4th Floor | St. Louis, MO 63101 |
T 314.588.0720 | F 314.588.0735 | spurcell@xxxxxxxxxxxxx | http://www.vertisinc.com

Vertis is a global powerhouse for integrated marketing and advertising solutions that seamlessly combine advertising, direct marketing, media, imaging and progressive technology. Vertis' products and services include: consumer and media research, media planning and placement, creative services, digital media production, targetable insert programs, fully integrated direct marketing programs, circulation-building newspaper products and eMarketing.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread