Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / February 2006

Tip: Looking for answers? Try searching our database.

Namespace prefix "my"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
andrew53 - 29 Jan 2006 05:48 GMT
How do I change the namespace prefix that Infopath uses in its XML documents
from "my" to something looking more professional? Or better yet, how do I
"teach" it to only specify the namespace on the root element and not use
prefixes on other nodes in the same namespace.
S.Y.M. Wong-A-Ton - 29 Jan 2006 14:16 GMT
Have you already tried creating your own XML document or schema and then
using the "New from XML Document or Schema..." option when creating a new
form or the "Tools > Convert Main Data Source..." menu item on an existent
form?
---
S.Y.M. Wong-A-Ton

> How do I change the namespace prefix that Infopath uses in its XML documents
> from "my" to something looking more professional? Or better yet, how do I
> "teach" it to only specify the namespace on the root element and not use
> prefixes on other nodes in the same namespace.
andrew53 - 29 Jan 2006 16:07 GMT
Of course I have. And it does work to some extent. But when I need to enable
digital signatures, IP will create them in a different namespace, and use
prefix "my" for it.
Like this:

<?xml version="1.0" encoding="UTF-8"?>
<?mso-infoPathSolution solutionVersion="1.0.0.1" productVersion="11.0.6565"
PIVersion="1.0.0.0" href="file:///C:\temp\bbb.xsn"
name="urn:schemas-microsoft-com:office:infopath:bbb:mynamespace"
language="ru" ?>
<?mso-application progid="InfoPath.Document"?>
<ns1:test
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-01-29T15:58:03"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:ns1="mynamespace">
    <ns1:a></ns1:a>
    <ns1:b></ns1:b>
    <my:signatures1>
        <my:signatures2></my:signatures2>
    </my:signatures1>
</ns1:test>

> Have you already tried creating your own XML document or schema and then
> using the "New from XML Document or Schema..." option when creating a new
[quoted text clipped - 7 lines]
> > "teach" it to only specify the namespace on the root element and not use
> > prefixes on other nodes in the same namespace.
Greg Collins [InfoPath MVP] - 30 Jan 2006 19:28 GMT
This is a limitation with InfoPath. Even if you successfully rename "my" everywhere, InfoPath will just put it back.

Signature

Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com

Of course I have. And it does work to some extent. But when I need to enable
digital signatures, IP will create them in a different namespace, and use
prefix "my" for it.
Like this:

<?xml version="1.0" encoding="UTF-8"?>
<?mso-infoPathSolution solutionVersion="1.0.0.1" productVersion="11.0.6565"
PIVersion="1.0.0.0" href="file:///C:\temp\bbb.xsn"
name="urn:schemas-microsoft-com:office:infopath:bbb:mynamespace"
language="ru" ?>
<?mso-application progid="InfoPath.Document"?>
<ns1:test
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-01-29T15:58:03"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="mynamespace">
<ns1:a></ns1:a>
<ns1:b></ns1:b>
<my:signatures1>
<my:signatures2></my:signatures2>
</my:signatures1>
</ns1:test>

"S.Y.M. Wong-A-Ton" wrote:

> Have you already tried creating your own XML document or schema and then
> using the "New from XML Document or Schema..." option when creating a new
[quoted text clipped - 9 lines]
> > "teach" it to only specify the namespace on the root element and not use
> > prefixes on other nodes in the same namespace.
Ramana - 01 Feb 2006 16:21 GMT
Hi,
when you want to change default namespace "my" , you have to do some changes
to schema.xsd file manually

Before changing,
<xsd:schema
targetNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-01-31T18:02:35"
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-01-31T18:02:35" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

When you want change “my” to “ns0”,

Ns0 namespace and targetnamespace should be same and you want apply this to
elements you have to put elementFormDefault="qualified" and for not
attributes you have to put attributeFormDefault="unqualified" ,

After changing
<xsd:schema targetNamespace="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
xmlns:ns0="http://xxxxxxxxxxxxxxxxxxxxxxxxxxx"
xmlns:xsd=http://www.w3.org/2001/XMLSchema elementFormDefault="qualified"
attributeFormDefault="unqualified">

I hope this will help you,

Signature

k.Ramana Reddy
www.autonomysystems.com

> How do I change the namespace prefix that Infopath uses in its XML documents
> from "my" to something looking more professional? Or better yet, how do I
> "teach" it to only specify the namespace on the root element and not use
> prefixes on other nodes in the same namespace.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.