By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,906 Members | 1,750 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,906 IT Pros & Developers. It's quick & easy.

getting around SOM limitations

P: n/a
Hey, I love the SOM buuuuuut,

I'm trying to add/read my own namespaced attribute in a node of my
schema without having to jump back and forth from SOM to DOM. I think a
sample is important here because there will certainly be confusion about
what kind of attribute I'm talking about. Here is the schema that I wish
to create dynamically (with SOM):

<xs:schema xmlns:xs="..." xmlns:my="myNs">
<xs:element name="myElement" my:specialAtt="specialVal" type="xs:string"/>
</xs:schema>

Again, I don't want to add a SOM attribute, really it's a DOM attribute
(qualified name) my:specialAtt that I want to add|read as I am
constructing|reading my schema using SOM. You can imagine what a pain it
would be to have to compile and write to a memorystream everytime I want
to access the value stored in the schema element declaration with DOM,
not to mention trying to find the correspoding element that I was
referring to with the SOM ... there has got to be a better way. I don't
want to use annotations - namespacing my own attributes in the places i
need them just seems a million times more elegant to me (if I could get
at them through SOM)

Help...

Rein
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Try as I might, the SOM just won't allow me to markup a schema with
custom namespace attributes (I'm not referring to xs:attribute...).
I'm stuck with appinfo tags... ahhh the verbosity, the sheer waste of
bandwidth... what a crying shame.
Rein

Rein Petersen wrote:
Hey, I love the SOM buuuuuut,

I'm trying to add/read my own namespaced attribute in a node of my
schema without having to jump back and forth from SOM to DOM. I think a
sample is important here because there will certainly be confusion about
what kind of attribute I'm talking about. Here is the schema that I wish
to create dynamically (with SOM):

<xs:schema xmlns:xs="..." xmlns:my="myNs">
<xs:element name="myElement" my:specialAtt="specialVal" type="xs:string"/>
</xs:schema>

Again, I don't want to add a SOM attribute, really it's a DOM attribute
(qualified name) my:specialAtt that I want to add|read as I am
constructing|reading my schema using SOM. You can imagine what a pain it
would be to have to compile and write to a memorystream everytime I want
to access the value stored in the schema element declaration with DOM,
not to mention trying to find the correspoding element that I was
referring to with the SOM ... there has got to be a better way. I don't
want to use annotations - namespacing my own attributes in the places i
need them just seems a million times more elegant to me (if I could get
at them through SOM)

Help...

Rein

Nov 12 '05 #2

P: n/a
You can add all such attributes to the UnhandledAttributes property on the
XmlSchema object. Read more @
http://msdn.microsoft.com/library/de...butestopic.asp

hope this helps,
Zafar

"Rein Petersen" <rm********@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Hey, I love the SOM buuuuuut,

I'm trying to add/read my own namespaced attribute in a node of my
schema without having to jump back and forth from SOM to DOM. I think a
sample is important here because there will certainly be confusion about
what kind of attribute I'm talking about. Here is the schema that I wish
to create dynamically (with SOM):

<xs:schema xmlns:xs="..." xmlns:my="myNs">
<xs:element name="myElement" my:specialAtt="specialVal" type="xs:string"/> </xs:schema>

Again, I don't want to add a SOM attribute, really it's a DOM attribute
(qualified name) my:specialAtt that I want to add|read as I am
constructing|reading my schema using SOM. You can imagine what a pain it
would be to have to compile and write to a memorystream everytime I want
to access the value stored in the schema element declaration with DOM,
not to mention trying to find the correspoding element that I was
referring to with the SOM ... there has got to be a better way. I don't
want to use annotations - namespacing my own attributes in the places i
need them just seems a million times more elegant to me (if I could get
at them through SOM)

Help...

Rein

Nov 12 '05 #3

P: n/a
Zafar! You rock! Thanks for responding :) Rein
Zafar Abbas [MSFT] wrote:
You can add all such attributes to the UnhandledAttributes property on the
XmlSchema object. Read more @
http://msdn.microsoft.com/library/de...butestopic.asp

hope this helps,
Zafar

"Rein Petersen" <rm********@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Hey, I love the SOM buuuuuut,

I'm trying to add/read my own namespaced attribute in a node of my
schema without having to jump back and forth from SOM to DOM. I think a
sample is important here because there will certainly be confusion about
what kind of attribute I'm talking about. Here is the schema that I wish
to create dynamically (with SOM):

<xs:schema xmlns:xs="..." xmlns:my="myNs">
<xs:element name="myElement" my:specialAtt="specialVal"


type="xs:string"/>
</xs:schema>

Again, I don't want to add a SOM attribute, really it's a DOM attribute
(qualified name) my:specialAtt that I want to add|read as I am
constructing|reading my schema using SOM. You can imagine what a pain it
would be to have to compile and write to a memorystream everytime I want
to access the value stored in the schema element declaration with DOM,
not to mention trying to find the correspoding element that I was
referring to with the SOM ... there has got to be a better way. I don't
want to use annotations - namespacing my own attributes in the places i
need them just seems a million times more elegant to me (if I could get
at them through SOM)

Help...

Rein


Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.