Namespace prefix "my"

A

andrew53

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

S.Y.M. Wong-A-Ton

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?
 
A

andrew53

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:eek:ffice: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>
 
G

Greg Collins [InfoPath MVP]

This is a limitation with InfoPath. Even if you successfully rename "my" everywhere, InfoPath will just put it back.

--
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:eek:ffice: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>
 
R

Ramana

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top