[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xmlns (flawed XML?) (edited)

Subject: Re: xmlns (flawed XML?) (edited)
From: Mike Ferrando <mikeferrando@xxxxxxxxx>
Date: Wed, 2 Jun 2004 10:03:48 -0700 (PDT)
marc21 slim
Friends,
Ok, sorry I didn't post any XSL.

My XSL was something like this:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns="http://www.loc.gov/MARC21/slim" 
  version="1.0">

<xsl:template match="/">
<html>
<!-- blah blah blah -->
<body>
<xsl:apply-templates select="//leader" mode="get_records"/>
</body>
</html>
</xsl:template>

<!-- other templates -->

</xsl:stylesheet>

I added the s: and the correct namespace to the stylesheet.
  xmlns:s="http://www.loc.gov/MARC21/slim"

<xsl:apply-templates select="//s:leader" mode="get_records"/>

Everything ran fine.

I thought the namespace was 'marc:'.

Thanks
Mike F.
Washington, DC

--- "M. David Peterson" <m.david@xxxxxxxxxx> wrote:
> It occurred to me that it would probably be helpful to see what a
> template 
> looks like that would work for this XML...
> 
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                 xmlns:s="http://www.loc.gov/MARC21/slim"
>                 version="1.0">
> <xsl:output method="xml"/>
> <xsl:template match="/">
>   <xsl:apply-templates select="//s:subfield[@code = 'a']"/>
> </xsl:template>
> <xsl:template match="s:subfield">
>   <xsl:copy-of select="."/>
> </xsl:template>
> </xsl:stylesheet>
> 
> Notice the namespace declaration for s... 
> xmlns:s="http://www.loc.gov/MARC21/slim"
> 
> Hope this helps!
> 
> <M:D/>
> 
> 
> ----- Original Message ----- 
> From: "M. David Peterson" <m.david@xxxxxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Sent: Wednesday, June 02, 2004 9:04 AM
> Subject: Re:  xmlns (flawed XML?) (edited)
> 
> 
> > Hey Mike,
> >
> > Looks like a namespace issue.  What you think you are able to
> access using 
> > "record/datafield" will return nothing.  You can prove this by
> taking your 
> > default namespace out or properly referencing your namespace in
> your XSLT 
> > (e.g. "s:record/s:datafield").  Without XSLT its tought to say
> for sure 
> > but this is usually the scenario in cases where there is a
> default 
> > namespace used in the XML.
> >
> > If this isnt the case let us know and we can help you further...
> >
> > Best of luck!
> >
> > <M:D/>
> >
> >
> > ----- Original Message ----- 
> > From: "Mike Ferrando" <mikeferrando@xxxxxxxxx>
> > To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> > Sent: Wednesday, June 02, 2004 8:27 AM
> > Subject:  xmlns (flawed XML?) (edited)
> >
> >
> > > Friends,
> > > [The last e-mail I sent had an example with more than one
> record (XML
> > > document) in it. Sorry.]
> > >
> > > I am having trouble trying to figure out why I cannot seem to
> write a
> > > stylesheet for this XML document.
> > >
> > > I suspect that the XML is not correct.
> > >
> > > Please take a look at it (below).
> > >
> > > My hunch is that it needs one or both of the following:
> > >   i) DOCTYPE statement pointing to a Schema or a DTD
> > >   ii) namespace prefix for the elements.
> > >
> > > Mike Ferrando
> > > Washington, DC
> > >
> > > ===XML:===
> > > <record xmlns="http://www.loc.gov/MARC21/slim">
> > >   <leader>01248cam  2200277 a 4500</leader>
> > >   <controlfield tag="001">12655819  </controlfield>
> > >   <controlfield tag="005">20030723214400.0  </controlfield>
> > >   <controlfield tag="008">020125s2002    enkab    b    001 0
> eng
> > > </controlfield>
> > >   <datafield tag="906" ind1=" " ind2=" ">
> > >     <subfield code="a">7</subfield>
> > >     <subfield code="b">cbc</subfield>
> > >     <subfield code="c">orignew</subfield>
> > >     <subfield code="d">1</subfield>
> > >     <subfield code="e">ecip</subfield>
> > >     <subfield code="f">20</subfield>
> > >     <subfield code="g">y-gencatlg</subfield>
> > >   </datafield>
> > >   <datafield tag="925" ind1="0" ind2=" ">
> > >     <subfield code="a">acquire</subfield>
> > >     <subfield code="b">2 shelf copies</subfield>
> > >     <subfield code="x">policy default</subfield>
> > >   </datafield>
> > >   <datafield tag="955" ind1=" " ind2=" ">
> > >     <subfield code="a">yh55 2002-01-25</subfield>
> > >     <subfield code="c">yh55 2002-01-25</subfield>
> > >     <subfield code="d">yh45 2002-01-25</subfield>
> > >     <subfield code="e">yh31 2002-01-28 to Dewey</subfield>
> > >     <subfield code="a">aa19 2002-01-28</subfield>
> > >     <subfield code="a">ps16 2002-05-10 bk rec&apos;d, to CIP
> > > ver.</subfield>
> > >     <subfield code="f">yg03 2002-05-13 to BCCD</subfield>
> > >     <subfield code="e">yk12 2002-06-06 Copy 2 to
> BCCD</subfield>
> > >   </datafield>
> > >   <datafield tag="010" ind1=" " ind2=" ">
> > >     <subfield code="a">  2002001234</subfield>
> > >   </datafield>
> > >   <datafield tag="020" ind1=" " ind2=" ">
> > >     <subfield code="a">0195145135</subfield>
> > >   </datafield>
> > >   <datafield tag="040" ind1=" " ind2=" ">
> > >     <subfield code="a">DLC</subfield>
> > >     <subfield code="c">DLC</subfield>
> > >     <subfield code="d">DLC</subfield>
> > >   </datafield>
> > >   <datafield tag="042" ind1=" " ind2=" ">
> > >     <subfield code="a">pcc</subfield>
> > >   </datafield>
> > >   <datafield tag="043" ind1=" " ind2=" ">
> > >     <subfield code="a">f-ae---</subfield>
> > >   </datafield>
> > >   <datafield tag="050" ind1="0" ind2="0">
> > >     <subfield code="a">DT295</subfield>
> > >     <subfield code="b">.C6115 2002</subfield>
> > >   </datafield>
> > >   <datafield tag="082" ind1="0" ind2="0">
> > >     <subfield code="a">965/.0462</subfield>
> > >     <subfield code="2">21</subfield>
> > >   </datafield>
> > >   <datafield tag="100" ind1="1" ind2=" ">
> > >     <subfield code="a">Connelly, Matthew James.</subfield>
> > >   </datafield>
> > >   <datafield tag="245" ind1="1" ind2="2">
> > >     <subfield code="a">A diplomatic revolution :</subfield>
> > >     <subfield code="b">Algeria&apos;s fight for independence
> and the
> > > origins of the post-cold war era /</subfield>
> > >     <subfield code="c">Matthew Connelly.</subfield>
> > >   </datafield>
> > >   <datafield tag="246" ind1="3" ind2="0">
> > >     <subfield code="a">Algeria&apos;s fight for independence
> and the
> > > origins of the post-cold war era</subfield>
> > >   </datafield>
> > >   <datafield tag="260" ind1=" " ind2=" ">
> > >     <subfield code="a">Oxford ;</subfield>
> > >     <subfield code="a">New York :</subfield>
> > >     <subfield code="b">Oxford University Press,</subfield>
> > >     <subfield code="c">2002.</subfield>
> > >   </datafield>
> > >   <datafield tag="300" ind1=" " ind2=" ">
> > >     <subfield code="a">xviii, 400 p. :</subfield>
> > >     <subfield code="b">ill., maps ;</subfield>
> > >     <subfield code="c">24 cm.</subfield>
> > >   </datafield>
> > >   <datafield tag="504" ind1=" " ind2=" ">
> > >     <subfield code="a">Includes bibliographical references (p.
> > > 361-385) and index.</subfield>
> > >   </datafield>
> > >   <datafield tag="651" ind1=" " ind2="0">
> > >     <subfield code="a">Algeria</subfield>
> > >     <subfield code="x">History</subfield>
> > >     <subfield code="y">Revolution, 1954-1962.</subfield>
> > >   </datafield>
> > >   <datafield tag="856" ind1="4" ind2="2">
> > >     <subfield code="3">Book review (H-Net)</subfield>
> > >     <subfield
> > > code="u">http://www.h-net.org/review/hrev-a0c5n4-aa</subfield>
> > >   </datafield>
> > > </record>
> > >
> > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Friends.  Fun.  Try the all-new Yahoo! Messenger.
> > > http://messenger.yahoo.com/
> > >
> > >
>
--+------------------------------------------------------------------
> > > XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> > > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> > > or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> > > --+--
> > >
> >
> >
>
--+------------------------------------------------------------------
> > XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> > or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> > --+--
> > 
> 
>
--+------------------------------------------------------------------
> XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> --+--
> 



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.