Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Smart Documents - XSD and Namespace

Hi, I'm evaluating the use of Excel Smart Documents for data entry systems
and have created an XSD for the data which I want to use both for Excel (to
describe the data) and in the Web service back-end for validation of the
same. However, when Excel attaches the XSD as a map, it assigns it own
namespace to it (typically ns1) which it then includes in the exported XML.
This means I can't verify it using the same XSD as the element namespaces no
longer match!!!

Is there a way around this or must I maintain 2 otherwise identical XSD's??
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Smart Documents - XSD and Namespace

Hi

Based on my research, the two schema should be compatible.
[Schema:SimpleSample]
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="SimpleSample"
targetNamespace="SimpleSample"
elementFormDefault="qualified"

<xsd:complexType name="exampleType"
<xsd:all
<xsd:element name="textbox" type="xsd:string"/
<xsd:element name="commandbutton" type="xsd:string"/
<xsd:element name="help" type="xsd:string"/
<xsd:element name="radiobutton" type="xsd:string"/
<xsd:element name="checkbox" type="xsd:string"/
<xsd:element name="listbox" type="xsd:string"/
<xsd:element name="image" type="xsd:string"/
<xsd:element name="documentfragment" type="xsd:string"/
<xsd:element name="activex" type="xsd:string"/
<xsd:element name="hyperlink" type="xsd:string"/
</xsd:all
</xsd:complexType

<xsd:element name="example" type="exampleType"/

</xsd:schema

[Export xml]
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?
- <ns1:example xmlns:ns1="SimpleSample"
<ns1:textbox1</ns1:textbox
<ns1:commandbutton /
<ns1:help /
<ns1:radiobutton /
<ns1:checkbox /
<ns1:listbox /
<ns1:image /
<ns1:documentfragment /
<ns1:activex /
<ns1:hyperlink /
</ns1:example

changed to
<?xml version="1.0" encoding="UTF-8" standalone="yes"?
<ns1:example xmlns:ns1="SimpleSample"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="SimpleSample C:\test\SimpleSample.xsd"
<ns1:textbox1</ns1:textbox
<ns1:commandbutton/
<ns1:help/
<ns1:radiobutton/
<ns1:checkbox/
<ns1:listbox/
<ns1:image/
<ns1:documentfragment/
<ns1:activex/
<ns1:hyperlink/
</ns1:example

We will find that we can use the SimpleSample.xsd to validate the exported
xml so they should be compatible. That is to say the webservice will
recognize the xml file.

If you have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Smart Documents - XSD and Namespace

Peter,

Thanks for the reply, I'll give it a try. It's not a very elegant solution
in that it requires inclusion of an arbitrary namespace into a custom
solution. Is this 'ns' namespace by design and will it continue to plague the
next release of Office?

""Peter Huang" [MSFT]" wrote:

Hi

Based on my research, the two schema should be compatible.
[Schema:SimpleSample]
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="SimpleSample"
targetNamespace="SimpleSample"
elementFormDefault="qualified"

<xsd:complexType name="exampleType"
<xsd:all
<xsd:element name="textbox" type="xsd:string"/
<xsd:element name="commandbutton" type="xsd:string"/
<xsd:element name="help" type="xsd:string"/
<xsd:element name="radiobutton" type="xsd:string"/
<xsd:element name="checkbox" type="xsd:string"/
<xsd:element name="listbox" type="xsd:string"/
<xsd:element name="image" type="xsd:string"/
<xsd:element name="documentfragment" type="xsd:string"/
<xsd:element name="activex" type="xsd:string"/
<xsd:element name="hyperlink" type="xsd:string"/
</xsd:all
</xsd:complexType

<xsd:element name="example" type="exampleType"/

</xsd:schema

[Export xml]
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?
- <ns1:example xmlns:ns1="SimpleSample"
<ns1:textbox1</ns1:textbox
<ns1:commandbutton /
<ns1:help /
<ns1:radiobutton /
<ns1:checkbox /
<ns1:listbox /
<ns1:image /
<ns1:documentfragment /
<ns1:activex /
<ns1:hyperlink /
</ns1:example

changed to
<?xml version="1.0" encoding="UTF-8" standalone="yes"?
<ns1:example xmlns:ns1="SimpleSample"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="SimpleSample C:\test\SimpleSample.xsd"
<ns1:textbox1</ns1:textbox
<ns1:commandbutton/
<ns1:help/
<ns1:radiobutton/
<ns1:checkbox/
<ns1:listbox/
<ns1:image/
<ns1:documentfragment/
<ns1:activex/
<ns1:hyperlink/
</ns1:example

We will find that we can use the SimpleSample.xsd to validate the exported
xml so they should be compatible. That is to say the webservice will
recognize the xml file.

If you have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Smart Documents - XSD and Namespace

Hi

I think the webservice can use the simplesample namespace, the ns1 is just
an alias for the SimpleSample. They should be compatible.
So far I can not make sure if the behavior will be changed in office
12.(next version)

Also I think you may try to send your feedback to the link below.
Make a suggestion
http://office.microsoft.com/en-us/co...spx?Sitename=0

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Smart Documents - XSD and Namespace

Peter, thanks for the suggestions but I think I might just wait for VSTO
2005, the existing frameworks are just to flakey and the plumbing required
too complex. I can't seem to manage getting anything to work in repeating
elements and since I can't seem to attach to the plumbing to debug it I'll
have to give up for now.

There seems to be too many fragmented bits in this arena at the moment
(VSTO, IBF, Smart Documents) none of which quite do what you want them too.
It's almost as if you guys were using this as an extended public beta before
releasing a unified solution that actually does something truly useful.

Here's hoping VSTO 2005 actually works.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Smart Documents - XSD and Namespace

Hi

Thanks for your understanding!
Please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Smart Documents - XSD and Namespace

Hello Paul,

I am reviewing this issue. Sorry for any incovenience that brought to you
and your team. If you are still monitoring the issue and want to know more
details on whether it can be workarounded in the current environment,
please feel free to reply here and we will consult smart document dev
engineer.

There is currently no easy way to do this, but keep an eye out for it in
the future. We are looking at continual improvement, and it's this kind of
feedback that let's us know what things you're trying to do, that we
haven't yet exposed for you.

Thanks very much for your understanding.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
-http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
p&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Smart Documents - XSD and Namespace

Hi Paul,

Hi, I'm evaluating the use of Excel Smart Documents for data entry systems
and have created an XSD for the data which I want to use both for Excel (to
describe the data) and in the Web service back-end for validation of the
same. However, when Excel attaches the XSD as a map, it assigns it own
namespace to it (typically ns1) which it then includes in the exported XML.
This means I can't verify it using the same XSD as the element namespaces no
longer match!!!

Is there a way around this or must I maintain 2 otherwise identical XSD's??


The solution to this is to include your own namespace in your xsd, using
whatever TLA you want, e.g.:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="some_long_namespace_identifier"
xmlns:foo="some_long_namespace_identifier"
elementFormDefault="qualified"
<xsd:element name="MyRoot"
</xsd:element
</xsd:schema

When Excel imports the xsd as a map, it will remember the namespace (i.e. the
"some_long_namespace_identifier", but will use its own TLA (ns1, ns2 etc). When
exported, it will use its own TLA, but use *your* namespace:

<?xml version="1.0" standalone="yes"?
<ns1:MyRoot xmlns:ns1="some_long_namespace_identifier"
</ns1:MyRoot

Now, because the "ns1" bit is nothing more than an alias used within the file
for some_long_namespace_identifier, that will validate fine against your xsd.
In other words, it's the "some_long_namespace_identifier" that has to match,
rather than the ns1 TLA.

Regards

Stephen Bullen
Microsoft MVP - Excel

Professional Excel Development
The most advanced Excel VBA book available
www.oaltd.co.uk/ProExcelDev


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I delete the test documents in my recent documents? mrjack Excel Discussion (Misc queries) 1 February 14th 10 04:08 PM
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp Yuvraj Excel Discussion (Misc queries) 3 May 3rd 09 11:59 AM
excel documents won't open from my documents folder Paul1961 Excel Discussion (Misc queries) 2 January 15th 06 05:31 PM
Macro looking to Outlook for namespace. gobjob Excel Programming 1 July 26th 05 11:58 PM
Excel Documents Don't Appear in My Recent Documents Addi Excel Discussion (Misc queries) 4 July 24th 05 09:43 PM


All times are GMT +1. The time now is 09:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"