[Metadatalibrarians] Namespace problems

Clay Redding clay at monarchos.com
Tue Sep 2 06:58:35 PDT 2008


Hi Greta,

I think your namespace declarations are fine, as long as you've  
declared the OAI namespace in the xsl:stylesheet element.  You can  
generally put it anywhere, but I tend to declare my namespaces  
globally at the root xsl:stylesheet element.

It appears that the error the validator is throwing says that  
<oai:record> is appearing as the first child in the modsCollection  
wrapper, which will result in an invalid instance, since <mods> is  
the only child allowed under <modsCollection>.  Typically, the  
correct structure is to have <oai:record>, and then your MODS  
instance within that.

If you'd like, feel free to send along your XML and XSL and we can  
help you troubleshoot.

Clay

On Aug 30, 2008, at 11:52 PM, Greta de Groat wrote:

> Hello again
>
> I've made progress on my namespace issues on my PastPerfect>MODs  
> stylesheet.  I think the MODS elements finally validated because i  
> got a series of error messages that i was able to correct.  I'm  
> using the validator at:
> http://www.validome.org/xml/validate/
> The last error message i haven't been able to clear seems to be  
> another namespace problem--this time oai:record isn't recognized.   
> I've got a bunch of namespaces and schemas declared in the <xsl>  
> element at the top of the stylesheet.  The validated files are:
>  	File name	Charsets	Source
> 1	SOURCECODE	UTF-8	XML declaration
> 2	http://www.loc.gov/standards/mods/v3/mods-3-2.xsd	UTF-8	XML  
> declaration
> 3	http://www.w3.org/2001/xml.xsd	UTF-8	Fallback
> 4	http://www.loc.gov/standards/xlink.xsd	UTF-8	XML declaration
>
> and the error message is:
> Line	File name:	Nonexistent
> 3	Column:	17
>  	Error:	Invalid content found starting with element 'oai:record'.  
> One of '{"http://www.loc.gov/mods/v3":mods}' is expected.
>  	Error Position:	<oai:record>
>
> That's the only oai element i have in the stylesheet, and it looks  
> like it's not getting recognized.  I tried putting it in the xsl  
> element, i tried putting it inside the <oai:record> element, and i  
> tried both places (which is the way it is at the moment), but  
> nothing seems to work.  It shows up as one of the namespaces in the  
> modsCollection element (i'm not sure why they output there, but the  
> rest seem to work, so i guess that's ok?).  The book i'm consulting  
> seems to say all the namespaces should be in the xsl element at the  
> top as long as i declare which namespace each element belongs to,  
> so i'm not sure what's going wrong here.  Any hints?
>
> thanks so much, i'm clearly out of my depth here and appreciate all  
> the help i can get.
>
> greta de groat
> Stanford University Libraries
>
>
> _______________________________________________
> Metadatalibrarians mailing list
> Metadatalibrarians at lists.monarchos.com
> http://lists.monarchos.com/listinfo.cgi/metadatalibrarians- 
> monarchos.com



More information about the Metadatalibrarians mailing list