473,322 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

accessing documentation elements/unhandled attributes via the som

I have some information embedded in included schemas which I want to
access at run-time for the purposes of contructing a GUI (they will
support field labels and tool tips).

The options seem to be to store them as documentation/appinfo elements
within the included schema or as unhandled attributes.

Because the schemas are included it seems the items would have to be
accessed via the SOM (as opposed to retrieving the details via XPATH)
but I can't see anyway how to do this. I think unhandled attributes
means having to use SAX but I can't see how.

Can anyone help.
Jul 20 '05 #1
1 1954
Please note a GUI can become very complicated... I ended up using a separate
xml file to store GUI info, because if you start using xsl an xsd looks more
daunting. I use the xsd for things set by vb and an xml ref file for things
set by xsl.
You can load the xsd as a DOMDocument.
After writing the code below I realised you can actually select the
attributes directly using selectSingleNode, which is what I now do for most
things. Selecting attributes directly means that instead of @name and @ref
you can just use @*="mynodename".
__________________________________________________ _______________________
Set m_XSDs = New MSXML2.XMLSchemaCache40
Set m_XSDDoc = New MSXML2.DOMDocument40
'sXSD is an XSD filename
m_XSDs.Add vbNullString, sXSD
Set m_XSD = m_XSDs.getSchema(vbNullString)
With m_XSDDoc
.validateOnParse = False
.async = False
.setProperty "SelectionLanguage", "XPath"
.setProperty "NewParser", True
.Load sXSD
.setProperty "SelectionNamespaces",
"xmlns:xs=""http://www.w3.org/2001/XMLSchema""
xmlns:sql=""urn:schemas-microsoft-com:mapping-schema"""
End With
__________________________________________________ _______________________
sxsdID = "xs:annotation/xs:appinfo/xs:mds"
Set oXMLAnnotation = oXMLAnnotationParent.selectSingleNode(sxsdID)
If oXMLAnnotation Is Nothing Then

For Each oXMLAttribute In oXMLAnnotationParent.Attributes

If oXMLAttribute.Name = "ref" Then
sxsdID = "/xs:schema/xs:element[@name=""" & oXMLAttribute.Value
& """]"
Set oXMLAnnotationParent =
m_XSDDoc.documentElement.selectSingleNode(sxsdID)
Exit For
End If

Next

sxsdID = "xs:annotation/xs:appinfo/xs:mds"
Set oXMLAnnotation = oXMLAnnotationParent.selectSingleNode(sxsdID)
End If
If Not oXMLAnnotation Is Nothing Then

For Each oXMLAttribute In oXMLAnnotation.Attributes

Select Case oXMLAttribute.Name
Case "type"

Select Case oXMLAttribute.Text
Case "hidden"
nAttribs = nAttribs Or vbHidden
Case "readonly"
nAttribs = nAttribs Or vbReadOnly
End Select
End Select

Next

End If

regards,
Will
http://fileant.com

"wooks" <wo****@hotmail.com> wrote in message
news:88**************************@posting.google.c om...
I have some information embedded in included schemas which I want to
access at run-time for the purposes of contructing a GUI (they will
support field labels and tool tips).

The options seem to be to store them as documentation/appinfo elements
within the included schema or as unhandled attributes.

Because the schemas are included it seems the items would have to be
accessed via the SOM (as opposed to retrieving the details via XPATH)
but I can't see anyway how to do this. I think unhandled attributes
means having to use SAX but I can't see how.

Can anyone help.

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Christopher Benson-Manica | last post by:
When are named elements written with script accessible to script? <html><head><script type="text/javascript"> function ready() { alert( document.getElementsByName("div").length ); }...
49
by: Aidan | last post by:
I rely heavily on MSDN for documentation when it comes to HTML/DHTML/JavaScript/CSS but as a result I often have problems getting my stuff to work in Netscape/Mozilla/Firefox. I like the MSDN...
1
by: Ole Hanson | last post by:
I would like to be able to generate documentation for a custom configuration file (xml) to enable future support engineers to understand applicable values to the various elements inside the...
2
by: Lisa | last post by:
I have to work with an existing xml where there is a root element and all other elements are children of the root (in other words there is no nesting or hierarchy), e.g. <myroot> <A>adata</A>...
6
by: Alfred B. Thordarson | last post by:
I have a problem accessing a DLL using C#. I'm using C/FRONT with Navision's CFRONT.DLL, which contains the method: DBL_S32* DBL_NextKey(DBL_HTABLE hTable, DBL_S32* Key); typedef signed long...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
3
by: Jim Lewis | last post by:
I have read several things that state accessing a Web Service through a Query String should work. However, when I try to execute http://localhost/webservice1/service1.asmx/HelloWorld I get the...
7
by: rein.petersen | last post by:
Hey All, I was wondering if there were a way for a script to access it's parent tag without having to use the document.all.tags method which doesn't necessarily identify it if there are more...
7
by: Chuck Anderson | last post by:
I'm pretty much a JavaScript novice. I'm good at learning by example and changing those examples to suit my needs. That said .... ..... I have some select fields in a form I created for a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.