Re: [xsl] Working with entities and notations

Subject: Re: [xsl] Working with entities and notations
From: dvint@xxxxxxxxx
Date: Wed, 27 Jul 2011 14:28:19 -0700
Maybe my solution is to parse the system value and just map the file
extension. Not fool proof, but another option.

..dan

> I havea  sitatuation where I need to process the following content:
>
> <!DOCTYPE dmodule [
> <!ENTITY ICN-GAASIB0-01-32-00-00-G00-0A-0YJB5-00002-B-B-01 SYSTEM
> "ICN-GAASIB0-01-32-00-00-G00-0A-0YJB5-00002-B-B-01.cgm" NDATA cgm>
> <!ENTITY ICN-GAASIB0-01-32-13-01-G00-0A-0YJB5-00001-B-B-01 SYSTEM
> "ICN-GAASIB0-01-32-13-01-G00-0A-0YJB5-00001-B-B-01.cgm" NDATA cgm>
> ]>
> <dmodule>
> <graphic boardno="ICN-GAASIB0-01-32-13-01-G00-0A-0YJB5-00001-B-B-01">
> <graphic boardno="ICN-GAASIB0-01-32-00-00-G00-0A-0YJB5-00002-B-B-01">
> </dmodule>
>
> The <graphic> has the following schema definition:
>
>    <xs:element name="graphic" type="graphicType"/>
>     <xs:complexType name="graphicType">
>         <xs:sequence>
>             <xs:element minOccurs="0" ref="applic"/>
>             <xs:element maxOccurs="unbounded" minOccurs="0"
> ref="hotspot"/>
>             <xs:element maxOccurs="unbounded" minOccurs="0" ref="rfa"/>
>         </xs:sequence>
>         <xs:attribute ref="refapplic"/>
>         <xs:attribute ref="boardno" use="required"/>
>         <xs:attribute ref="reprowid"/>
>         <xs:attribute ref="reprohgt"/>
>         <xs:attribute ref="reproscl"/>
>         <xs:attributeGroup ref="bodyatt"/>
>         <xs:attributeGroup ref="cntlcontent"/>
>         <xs:attributeGroup ref="secur"/>
>         <xs:attributeGroup ref="xlink:XLINKATT0"/>
>     </xs:complexType>
>
> I can see how unparsed-entity-uri() will get me the SYSTEM information by
> using the boardno attribute on the graphic tag. My problem is that I don't
> see anyway to extract the notation or NDATA value. I know I have at least
> CGM and ISO (IsoDraw) notations that I need to work with, so I can't just
> default to CGM.
>
> I'm trying to convert this XML file and produce a slightly modified one
> without changing the schema or the existing markup. My only thought
> currently is to preprocess with Perl or something - make some new dummy
> tags with the information and then do my actual pass using that info and
> stripping out the intermediate tags. Seems like there should be a better
> way.
>
> ..dan

Current Thread