IP does not recognize Namespace prefixes - InfoPath Dev
in

InfoPath Dev

IP does not recognize Namespace prefixes

Last post 06-26-2008 11:47 AM by Greg Collins. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 06-20-2008 08:56 AM

    IP does not recognize Namespace prefixes

    I am working on an infopath solution that uses an external schema.  The schema imports 10schema.  Each imported schema has its own namespace and ns prefix.  IP does not recognize the ns/prefix declaration in the schema.  Below is the schema element and imports: 

    <xs:schema

    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:drm="models/drm"
    xmlns:org="models/org"
    xmlns:db="models/db"
    xmlns:note="application/notes"
    xmlns:contact="models/contacts"
    xmlns:ObjMeta="application/ObjectMeta"
    xmlns:hw="models/hardware"
    xmlns:pm="models/programmodel"
    xmlns:id="application/globalid"
    xmlns:sc="models/securitymodel"
    xmlns:rm2="models/relationshipmodel2"
    targetNamespace="models/drm"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
     

     <xs:import namespace="models/hardware" schemaLocation="hardwaremodel.xsd"/>
     <xs:import namespace="models/db" schemaLocation="databasemodel.xsd"/>
     <xs:import namespace="models/contacts" schemaLocation="contactmodel.xsd"/>
     <xs:import namespace="models/relationshipmodel2" schemaLocation="relationshipmodelv2.xsd"/>
     <xs:import namespace="models/programmodel" schemaLocation="programmodel.xsd"/>
     <xs:import namespace="models/org" schemaLocation="oemodel.xsd"/>
     <xs:import namespace="application/notes" schemaLocation="../application/noteschema.xsd"/>
     <xs:import namespace="application/ObjectMeta" schemaLocation="../application/objectmetaschema.xsd"/>
     <xs:import namespace="application/globalid" schemaLocation="../application/globalidmodel.xsd"/>
     <xs:import namespace="models/securitymodel" schemaLocation="secuitymodel.xsd"/>

    I read Greg Collins' article on prefixes and it appears that I have all of the declarations needed.  The only thing I can think of is the targetNamespace attribute is third from last.  Could IP's parser be looking for the targetNamepace attribute at the begining of the element, not seeing it and creating the ns1..nsn prefixes?  I've tried moving it, but Altova XMLSpy keeps moving back to the end.

     

    Thank you

    Ren

  • 06-20-2008 04:04 PM In reply to

    Re: IP does not recognize Namespace prefixes

    The first thing that could be an issue: the use of "../" in your schemaLocation attribute. Try grouping all the required schemas into the same folder and eliminating the parent folder references ("../").

    The second (probably not an issue, but you never know), most namespace definitions are a URI, such as namespace=http://www.somesite.com/application/globalid.

  • 06-23-2008 08:11 AM In reply to

    Re: IP does not recognize Namespace prefixes

    Greg thanks,

     

    Greg Collins:
    The second (probably not an issue, but you never know), most namespace definitions are a URI, such as namespace=http://www.somesite.com/application/globalid.

    Sorry, the namespaces are actually URIs.  I just chopped off the http://www.somesite.com/ to protect my client's privacy.

    Greg Collins:
    The first thing that could be an issue: the use of "../" in your schemaLocation attribute. Try grouping all the required schemas into the same folder and eliminating the parent folder references ("../").

    Unfornuately, I can't change the folders for the schema in the production environment.  The schema are in an enterprise repository.

    Once, again thank you,

     

     

    Ren

  • 06-23-2008 03:33 PM In reply to

    Re: IP does not recognize Namespace prefixes

    It doesn't matter so much about the production environment setup. This is just for starting a new InfoPath form right? InfoPath will make a copy of all those schemas internal to the form template anyway. So just copy all the schemas into a single folder, fix them up to not have any "out of folder" references, then you should be able (hopefully) to create the new form using the external schema without issue.

     

  • 06-26-2008 06:24 AM In reply to

    Re: IP does not recognize Namespace prefixes

    Greg thanks, I think I got it working.

     

     

    Ren

  • 06-26-2008 11:47 AM In reply to

    Re: IP does not recognize Namespace prefixes

    Great! Glad to hear it!

Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.