powered by simpleCommunicator - 2.0.53     © 2025 Programmizd 02
Форумы / Visual Basic [игнор отключен] [закрыт для гостей] / работа с xml
13 сообщений из 38, страница 2 из 2
работа с xml
    #38396566
Фотография Antonariy
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
qwerty112,

И файл без схемы, и кириллицу можно. Файл считается со схемой, когда внутри него присутствует блок
Код: xml
1.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> 

Да и эта копипаста у меня загрузилась без ошибок.

Проблема не в тексте, а файле, скорее всего там битый юникод.
...
Рейтинг: 0 / 0
работа с xml
    #38396571
qwerty112
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Antonariyqwerty112,

И файл без схемы, и кириллицу можно. Файл считается со схемой, когда внутри него присутствует блок
Код: xml
1.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> 



неймспейс, я имел в виду, конечно ...

AntonariyДа и эта копипаста у меня загрузилась без ошибок.

Проблема не в тексте, а файле, скорее всего там битый юникод.
даа, сохранил исходный копипаст в UTF-8, - всё "заработало" ...
видимо и у Эндрю проблема в этом - сохраняет в АНСИ...
...
Рейтинг: 0 / 0
работа с xml
    #38396572
Фотография Antonariy
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
qwerty112неймспейс, я имел в виду, конечно ...Сам по себе неймспейс не определяет контент, только если еще присутствует путь к схеме. Без явного указания схемы в файле или при загрузке, а так же указания эту схему использовать, DOMDocument примет любую кучу-малу, если она синтаксически корректна.
...
Рейтинг: 0 / 0
работа с xml
    #38396576
qwerty112
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Antonariyqwerty112неймспейс, я имел в виду, конечно ...Сам по себе неймспейс не определяет контент, только если еще присутствует путь к схеме.

он определяет множество используемых тегов и их, так сказать, "типы"+возможно, множество значений - так что "по смыслу" это та же схема

AntonariyБез явного указания схемы в файле или при загрузке, а так же указания эту схему использовать, DOMDocument примет любую кучу-малу, если она синтаксически корректна.
вот это (ниже) - синтаксически правильная "куча-мала" ?
её DOMDocument - не принимает
а всего-то нет указания используемого неймспейса ...
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
<?xml version="1.0"?>
<FL:smarttaglist>
	<FL:name>Medical Condition Terms</FL:name> 
	<FL:lcid>1049</FL:lcid> 
	<FL:description>A list of medical conditions for recognition, as well as a set of actions that work with them.</FL:description> 
	<FL:moreinfourl>http://www.adatum.com/moreinfo</FL:moreinfourl> 
	<FL:updateable>true</FL:updateable> 
	<FL:autoupdate>true</FL:autoupdate> 
	<FL:lastcheckpoint>100</FL:lastcheckpoint> 
	<FL:lastupdate>0</FL:lastupdate> 
	<FL:updateurl>http://www.adatum.com/smarttags/listupdate.xml</FL:updateurl> 
	<FL:updatefrequency>5</FL:updatefrequency> 
	<FL:smarttag type="urn:schemas-adatum-com:medical#condition">
		<FL:caption>Действие кванта</FL:caption> 
		<FL:terms>
			<FL:termlist>allergy, kvant, квант</FL:termlist> 
		</FL:terms>
		<FL:actions>
			<FL:action id="CompanyInfo">
				<FL:caption>&A. Datum Corporation Company Reports</FL:caption> 
				<FL:url>http://www.adatum.com</FL:url> 
			</FL:action>
			<FL:action id="CompanyHomePage">
				<FL:caption>View A. &Datum Website</FL:caption> 
				<FL:url>http://www.adatum2.com/home.asp?String={TEXT}</FL:url> 
			</FL:action>
			<FL:action id="YandexSearch">
				<FL:caption>Искать в &Яндексе</FL:caption> 
				<FL:url>http://yandex.ru/yandsearch?text={TEXT}</FL:url> 
			</FL:action>
		</FL:actions>
	</FL:smarttag>
</FL:smarttaglist>
...
Рейтинг: 0 / 0
работа с xml
    #38396578
Фотография Antonariy
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
qwerty112он определяет множество используемых тегов и их, так сказать, "типы"+возможно, множество значений - так что "по смыслу" это та же схема Абсолютно нет. Ну вот скажи, где в этом тексте определение этого самого множества?

Код: plaintext
xmlns:FL="urn:schemas-microsoft-com:smarttags:list"

qwerty112вот это (ниже) - синтаксически правильная "куча-мала" ?
её DOMDocument - не принимает
а всего-то нет указания используемого неймспейса ...Все неймспейсы должны быть объявлены, факт. Однако без схемы они для DOMDocument не значат ровным счетом ничего.
Схемой, кстати, можно описать документ и не использующий именные неймспейсы. У него будет просто xmlns="...".

Ну и в заключение попробуй загрузить тот же текст с таким заголовком:
Код: xml
1.
<FL:smarttaglist xmlns:FL="привет, мир">
...
Рейтинг: 0 / 0
работа с xml
    #38396584
qwerty112
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Antonariyqwerty112он определяет множество используемых тегов и их, так сказать, "типы"+возможно, множество значений - так что "по смыслу" это та же схема Абсолютно нет. Ну вот скажи, где в этом тексте определение этого самого множества?

Код: plaintext
xmlns:FL="urn:schemas-microsoft-com:smarttags:list"

...несогласен я :)
то, что DOMDocument, условно, - "наплевать" на эти именования - ничего не значит,
вот той "штуковине" которая будет интерпретировать этот хмл, и строить по нему смарт-теги - уже очень сильно НЕ "наплевать"
а что значит этот "urn:schemas-microsoft-com:smarttags:list" в данном конкретном случае .... - нуу, например идентификатор словаря "жёстко забитый" в этот интерпритатор ...

Antonariyqwerty112вот это (ниже) - синтаксически правильная "куча-мала" ?
её DOMDocument - не принимает
а всего-то нет указания используемого неймспейса ...Все неймспейсы должны быть объявлены, факт. Однако без схемы они для DOMDocument не значат ровным счетом ничего.
Схемой, кстати, можно описать документ и не использующий именные неймспейсы. У него будет просто xmlns="...".

Ну и в заключение попробуй загрузить тот же текст с таким заголовком:
Код: xml
1.
<FL:smarttaglist xmlns:FL="привет, мир">


да, я пробывал, с таким :))
Код: xml
1.
<FL:smarttaglist xmlns:FL="http://djepa">


грузится.

но это ничего не значит - идея была именно такая - по ссылке неймспейса, находится "словарь" определяющий тег
просто [пока ?] это не критическое требование, ... как-то так
http://ru.wikipedia.org/wiki/????????????_???_(XML) Пространство имён XML не требует, чтобы был определён его словарь, хотя существует сложившаяся практика помещать DTD или XML Schema, определяющие точную структуру данных в контексте конкретного пространства имён.
...
Рейтинг: 0 / 0
работа с xml
    #38396595
Фотография Antonariy
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
qwerty112вот той "штуковине" которая будет интерпретировать этот хмл, и строить по нему смарт-теги - уже очень сильно НЕ "наплевать" Вот именно! :) За валидацию отвечает штуковина, запускающая метод валидации, а не содержимое xmlns, якобы говорящее "валидируй меня". И именно штуковина отвечает за то, чтобы парсер мог найти сами схемы, и парсер обладает методами для загрузки схем. За исключением одного случая, о котором ниже.

qwerty112нуу, напримерПохоже, половину своих "познаний" по xml ты просто выдумал :)

qwerty112но это ничего не значит - идея была именно такая - по ссылке неймспейса, находится "словарь" определяющий тег
просто [пока ?] это не критическое требование, ... как-то так
http://ru.wikipedia.org/wiki/????????????_???_(XML) Пространство имён XML не требует, чтобы был определён его словарь, хотя существует сложившаяся практика помещать DTD или XML Schema, определяющие точную структуру данных в контексте конкретного пространства имён.
Ты совершенно не понял, что прочитал. Парсеру наплевать на сложившуюся практику, он не ходит по адресам, указанным в xmlns. То, что находится в значении атрибута xmlns, это сферический идентификатор в вакууме. Конкретный пример:
http://www.w3.org/TR/xml-names/ The URI references below are all different for the purposes of identifying namespaces, since they differ in case:

http://www.example.org/wine
http://www.Example.org/wine
Если бы это были физические пути, то они были бы одинаковые. Да и насчет "сложившейся практики" перебор. Лишь один-два урла из десяти, проверенных мной ради интереса, содержали схемы. Урлы самого w3.org ведут не не схемы, а документацию.

А схема находится по другой ссылке . Это и есть тот самый исключительный для парсера случай.
...
Рейтинг: 0 / 0
работа с xml
    #38396605
катастрофа
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
други, Ваша правда, работает, пока выложу код для себя чтобы не забыть

Код: vbnet
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
Option Explicit

Sub xml()

Dim strTemp As String
Dim xmlParser As Object
'Создаём OLE-объект DOMDocument
Set xmlParser = CreateObject("Msxml2.DOMDocument")
'Отключаем асинхронную загрузку
xmlParser.async = False
'Загружаем XML-документ, его кодировка должна быть UTF-8 или UTF-8(без BOM)
xmlParser.Load "C:\1.xml"
'Если случилась ошибка, выдаём информацию о ней и завершаем работу
If xmlParser.parseError.errorCode <> 0 Then
    With xmlParser.parseError
  strTemp = "errorCode: " & .errorCode & vbCrLf & _
            "filepos: " & .filepos & vbCrLf & _
            "line: " & .Line & vbCrLf & _
            "linepos: " & .linepos & vbCrLf & _
            "reason: " & .reason & vbCrLf & _
            "srcText: " & .srcText & vbCrLf & _
            "url: " & .URL
End With
MsgBox$ strTemp
    Exit Sub
End If
'Выводим содержимое XML-документа
MsgBox$ xmlParser.xml
'Освобождаем объектную переменную
Set xmlParser = Nothing

End Sub



пока хмл мне делают, сделают буду знать структуру, если что спрошу
СПАСИБО
...
Рейтинг: 0 / 0
работа с xml
    #38396723
qwerty112
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
так,... я сначала "внесу ясность" :) по-поводу чего мы спорим:
- тут 14838733 по-поводу схемы я говорю "хрень", с чем уже 2-жды согласился.
да, DOMDocument, в случае неймспейсов - "верит нам на слово", по поводу имён/типов на которые мы ссылаемся, как "типа" определённые в неймспейсе "urn:schemas-microsoft-com:smarttags:list"

вся дальнейшая "беседа" вот из-за этого твоего поста:
Antonariyqwerty112неймспейс, я имел в виду, конечно ...
Сам по себе неймспейс не определяет контент, только если еще присутствует путь к схеме. Без явного указания схемы в файле или при загрузке, а так же указания эту схему использовать, DOMDocument примет любую кучу-малу, если она синтаксически корректна.
определяет
...
Рейтинг: 0 / 0
работа с xml
    #38396726
qwerty112
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Antonariyqwerty112вот той "штуковине" которая будет интерпретировать этот хмл, и строить по нему смарт-теги - уже очень сильно НЕ "наплевать" Вот именно! :) За валидацию отвечает штуковина, запускающая метод валидации, а не содержимое xmlns, якобы говорящее "валидируй меня".

так, а по каким правилам будет выполнятся эта валидация ?
xmlns - и задаёт эти правила !
только не для DOMDocument-а (тот - "верит на слово"), а для "штуковины" - той приблуды, которая будет из вх.хмл-я делать "крассивые смарт-теги" в оффисных приложениях (я не знаю что это, наверняка какая-то dll-ка в оффисе)

Antonariyqwerty112но это ничего не значит - идея была именно такая - по ссылке неймспейса, находится "словарь" определяющий тег
просто [пока ?] это не критическое требование, ... как-то так
пропущено...
Ты совершенно не понял, что прочитал. Парсеру наплевать на сложившуюся практику, он не ходит по адресам, указанным в xmlns.

а ты не понял моего комментария: "Задумывалось так", "идея была такая" - сделать что-то типа "библиотек типов", что бы можно было не создавать под каждый новый хмл описание типов, а ссылатся на готовые,
более того - ссылатся на несколько разных "готовых" в одном хмл-е

вот "получилось" - немного не так, потому эти "адресса", это и не адресса, а идентификаторы,
отсюда "растут ноги" и твоего примера с разным регистром в "адрессе"
AntonariyТо, что находится в значении атрибута xmlns, это сферический идентификатор в вакууме.
вот у меня непроходит впечатление, что ты считаешь эти неймспейсы какой-то "профанацией", которая не значит ровным счётом ничего ... - так это не так
...
Рейтинг: 0 / 0
работа с xml
    #38396727
qwerty112
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
"неполенился" :)

вот схема, которую задаёт неймспейс
mostlAnnotated.xsd
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
447.
448.
449.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
462.
463.
464.
465.
466.
467.
468.
469.
470.
471.
472.
473.
474.
475.
476.
477.
478.
479.
480.
481.
482.
483.
484.
485.
486.
487.
488.
489.
490.
491.
492.
493.
494.
495.
496.
497.
498.
499.
500.
501.
502.
503.
504.
505.
506.
507.
508.
509.
510.
511.
512.
513.
514.
515.
516.
517.
518.
519.
520.
521.
522.
523.
524.
525.
526.
527.
528.
529.
530.
531.
532.
533.
534.
535.
536.
537.
538.
539.
540.
541.
542.
543.
544.
545.
546.
547.
548.
549.
550.
551.
552.
553.
554.
555.
556.
557.
558.
559.
560.
561.
562.
563.
564.
565.
566.
567.
568.
569.
570.
571.
572.
573.
574.
575.
576.
577.
578.
579.
580.
581.
582.
583.
584.
585.
586.
587.
588.
589.
590.
591.
592.
593.
<?xml version="1.0" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >>>targetNamespace="http://schemas.microsoft.com/office/smarttags/2003/mostl"<<< xmlns="http://schemas.microsoft.com/office/smarttags/2003/mostl" xmlns:o="http://schemas.microsoft.com/office/smarttags/2003" elementFormDefault="qualified">
	
	<xsd:import namespace="http://schemas.microsoft.com/office/smarttags/2003"/>
	
	<xsd:annotation>
		<xsd:documentation>This document is provided for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE INFORMATION IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user.  Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. © 2003 Microsoft Corporation. All rights reserved.</xsd:documentation>
		<xsd:documentation>This XML schema provides a method for smart tag list (MOSTL) developers to determine the validity of their smart tags/smart documents quickly and easily.</xsd:documentation>
	</xsd:annotation>
	
	<xsd:element name="smartTagList" type="smartTagListType">
		<xsd:annotation>
			<xsd:documentation> The root element required for a valid MOSTL file.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	
	<xsd:complexType name="smartTagListType">
		<xsd:annotation>
			<xsd:documentation>The top level contents for a valid MOSTL definition.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="name" type="stringType">
				<xsd:annotation>
					<xsd:documentation>A 'friendly name' which will be used to define your smart tag in the Smart Tag list UI. A 'friendly name' not used for display for Smart Documents.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="lcid" minOccurs="0" type="stringType">
				<xsd:annotation>
					<xsd:documentation>This defines to the host application the languages in which items in which the file should be loaded (by specifying the locale ID).</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="description" type="stringType">
				<xsd:annotation>
					<xsd:documentation>A more detailed description of the function of this smart tag/smart document.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="moreInfoURL" minOccurs="0" type="stringType">
				<xsd:annotation>
					<xsd:documentation>A URL where a user can find more information on this smart tag/smart document. Not displayed in the UI.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="downloadURL" minOccurs="0" type="stringType">
				<xsd:annotation>
					<xsd:documentation>Provides an HTML location where the "Check for new actions.." link on the smart tag will point. Not used for smart documents.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="updateable" minOccurs="0" type="xsd:boolean">
				<xsd:annotation>
					<xsd:documentation>Indicates whether this smart tag/smart document is updateable.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="autoUpdate" minOccurs="0" type="xsd:boolean">
				<xsd:annotation>
					<xsd:documentation>Indicates whether this smart tag/smart document should update automatically in the background.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="lastCheckpoint" minOccurs="0" type="xsd:integer">
				<xsd:annotation>
					<xsd:documentation>An integer ID indicating the 'version' of the file which was installed.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="lastUpdate" minOccurs="0" type="nonZeroInteger">
				<xsd:annotation>
					<xsd:documentation>A long integer representing the number of minutes since 1970 since the file was last updated.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="updateURL" minOccurs="0" type="stringType">
				<xsd:annotation>
					<xsd:documentation>The URL or other location which the update procedure should check for potential updates, using the MOSTL update mechanism.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="updateFrequency" minOccurs="0" type="nonZeroInteger">
				<xsd:annotation>
					<xsd:documentation>An integer indicating the number of minutes that should elapse between successive calls to the update URL above to check for updates.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:choice>
				<xsd:element name="smartTag" maxOccurs="unbounded" type="smartTagType">
					<xsd:annotation>
						<xsd:documentation>The root element for a smart tag MOSTL definition.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="smartDoc" maxOccurs="unbounded" type="smartDocType">
					<xsd:annotation>
						<xsd:documentation>The root element for a smart document MOSTL definition.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:simpleType name="nonZeroInteger">
		<xsd:annotation>
			<xsd:documentation>A custom type which includes all positive integers, as well as zero.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:integer">
			<xsd:minInclusive value="0" />
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:complexType name="smartTagType">
		<xsd:annotation>
			<xsd:documentation>The root element for a specific smart tag type within the MOSTL file.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="solutionID" minOccurs="0" type="stringType">
				<xsd:annotation>
					<xsd:documentation>The smart document solution ID with which this MOSTL file is associated (if the MOSTL smart tag is not linked to a smart document, omit this tag).</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="propertyPage" minOccurs="0" type="stringType">
				<xsd:annotation>
					<xsd:documentation>A URL to be associated withe the Properties.. button in the Smart Tag tab.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="caption" type="stringType">
				<xsd:annotation>
					<xsd:documentation>The caption on the smart tag dropdown when the tag is recognized.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:choice>
				<xsd:element name="terms" type="termsType">
					<xsd:annotation>
						<xsd:documentation>Contains the definition of the terms to be recognized under this smart tag.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="re" type="regularExpressionsType">
					<xsd:annotation>
						<xsd:documentation>Contains the definition of regular expressions to be recognized under this smart tag.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="cfg" type="contextFreeGrammarsType">
					<xsd:annotation>
						<xsd:documentation>Contains the definition of context free grammars to be recognized under this smart tag.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="includeFile" type="stringType">
					<xsd:annotation>
						<xsd:documentation>Contains a path of an external XML file with CFG/RE definitions to be recognized under this smart tag.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
			</xsd:choice>
			<xsd:element name="property" minOccurs="0" type="stringType">
				<xsd:annotation>
					<xsd:documentation>Contains a single property name and value pair to be passed to the smart tag action handler when the term is recognized.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="actions" minOccurs="0" type="mostlActionsType">
				<xsd:annotation>
					<xsd:documentation>Container for the actions associated with the current smart tag.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
		<xsd:attribute name="type" use="required" type="stringType">
			<xsd:annotation>
				<xsd:documentation>The name (in namespace#tagname format) by which the current smart tag should be defined. Must be unique.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>
	
	<xsd:complexType name="smartDocType">
		<xsd:annotation>
			<xsd:documentation>The root element for the smart document controls associated with an XML element within the MOSTL file. Each set of controls bound to an XML element will have its own smartDoc tag.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="solutionID" minOccurs="0" type="stringType">
				<xsd:annotation>
					<xsd:documentation>The smart document solution ID with which this MOSTL file is associated.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="caption" type="stringType">
				<xsd:annotation>
					<xsd:documentation>The caption on the Smart Document exposed through the XML Expansion Packs tab (if not installed via manifest).</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="actions" minOccurs="0" type="smartDocActionsType">
				<xsd:annotation>
					<xsd:documentation>Container for the controls associated with the current XML element.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
		<xsd:attribute name="type" use="required" type="stringType">
			<xsd:annotation>
				<xsd:documentation>The name (in namespace#tagname format) of the XML element for which the current controls are defined.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>
	
	<xsd:complexType name="termsType">
		<xsd:annotation>
			<xsd:documentation>Defines how the terms will be provided to the MOSTL file (either via a binary file, or a text listing).</xsd:documentation>
		</xsd:annotation>
		<xsd:choice>
			<xsd:element name="termList" type="stringType">
				<xsd:annotation>
					<xsd:documentation>Contains a comma-delimited list of terms which will be recognized by this smart tag.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="termFile" type="termFileType">
				<xsd:annotation>
					<xsd:documentation>Contains an XML element pointing to the file location of the term list.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="termListWithProps" type="termListWithPropsType">
				<xsd:annotation>
					<xsd:documentation>Contains a term list with the ability to set properties on the property bag.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:choice>
	</xsd:complexType>
	
	<xsd:complexType name="regularExpressionsType">
		<xsd:annotation>
			<xsd:documentation>Contains definition of regular expressions to be recognized by this smart tag.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="prop" minOccurs="0" type="propertyValueType">
				<xsd:annotation>
					<xsd:documentation>An element used to specify information to be written to the property bag on recognition of a smart tag.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="exp" maxOccurs="unbounded" type="regularExpressionType">
				<xsd:annotation>
					<xsd:documentation>The container for a single expression to recognize.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="termFileType">
		<xsd:annotation>
			<xsd:documentation>Contains an element defining the filename of a binary file used for recognized terms.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="prop" minOccurs="0" type="propertyValueType">
				<xsd:annotation>
					<xsd:documentation>An element used to specify information to be written to the property bag on recognition of a smart tag.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="fileName" type="stringType">
				<xsd:annotation>
					<xsd:documentation>The filepath and name of the binary trie which contains the term list to be recognized.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="termListWithPropsType">
		<xsd:annotation>
			<xsd:documentation>Contains the information associated with a termlist with property bag definitions.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="prop" minOccurs="0" type="propertyValueType">
				<xsd:annotation>
					<xsd:documentation>An element used to specify information to be written to the property bag on recognition of a smart tag.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="t" maxOccurs="unbounded" type="termType">
				<xsd:annotation>
					<xsd:documentation>The container for a single term to recognize.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="contextFreeGrammarsType">
		<xsd:annotation>
			<xsd:documentation>Contains definition of context free grammars to be recognized by this smart tag.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="rule" maxOccurs="unbounded" type="cfgRuleType">
				<xsd:annotation>
					<xsd:documentation>A rule for parsing this context free grammar.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
		<xsd:attribute name="topRule" type="stringType" use="required">
			<xsd:annotation>
				<xsd:documentation>The top rule (first rule to use) when parsing the CFG.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>
	
	<xsd:complexType name="cfgRuleType">
		<xsd:annotation>
			<xsd:documentation>Contains a rule for parsing for the context free grammar.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="prop" minOccurs="0" type="propertyValueType">
				<xsd:annotation>
					<xsd:documentation>An element used to specify information to be written to the property bag on recognition of this term.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:choice maxOccurs="unbounded">
				<xsd:element name="l" type="lType">
					<xsd:annotation>
						<xsd:documentation>A context free grammar list of possible elements or derivations.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="o" type="oType">
					<xsd:annotation>
						<xsd:documentation>A optional sentential element of a derivation or an encapsulation of an optional derivation.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="p" type="pType">
					<xsd:annotation>
						<xsd:documentation>A sentential element of a derivation or an encapsulation of a derviation.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="ruleRef" type="rulerefType">
					<xsd:annotation>
						<xsd:documentation>A reference to another rule (non-terminal) in the grammar.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
			</xsd:choice>
		</xsd:sequence>
		<xsd:attribute name="name" type="stringType" use="required">
			<xsd:annotation>
				<xsd:documentation>Defines the unique name of the current rule in the grammar.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>
	
	<xsd:complexType name="lType">
		<xsd:annotation>
			<xsd:documentation>Contains the definition of a context free grammar list of possible elements or derivations.</xsd:documentation>
		</xsd:annotation>
		<xsd:choice maxOccurs="unbounded">
			<xsd:element name="p" type="pType">
				<xsd:annotation>
					<xsd:documentation>A sentential element of a derivation or an encapsulation of a derviation.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="ruleRef" type="rulerefType">
				<xsd:annotation>
					<xsd:documentation>A reference to another rule (non-terminal) in the grammar.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:choice>
	</xsd:complexType>
	
	<xsd:complexType name="oType">
		<xsd:annotation>
			<xsd:documentation>Contains the definition of an optional sentential element of a derivation or an encapsulation of an optional derivation.</xsd:documentation>
		</xsd:annotation>
		<xsd:choice maxOccurs="unbounded">
			<xsd:element name="l" minOccurs="0" maxOccurs="unbounded" type="lType">
				<xsd:annotation>
					<xsd:documentation>A context free grammar list of possible elements or derivations.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="p" minOccurs="0" maxOccurs="unbounded" type="pType">
				<xsd:annotation>
					<xsd:documentation>A sentential element of a derivation or an encapsulation of a derviation.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="ruleRef" minOccurs="0" maxOccurs="unbounded" type="rulerefType">
				<xsd:annotation>
					<xsd:documentation>A reference to another rule (non-terminal) in the grammar.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:choice>
	</xsd:complexType>
	
	<xsd:complexType name="pType" mixed="true">
		<xsd:annotation>
			<xsd:documentation>Contains the definition of a sentential element of a derivation or an encapsulation of a derviation.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="prop" minOccurs="0" type="propertyValueType">
				<xsd:annotation>
					<xsd:documentation>An element used to specify information to be written to the property bag on recognition of a term.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="rulerefType">
		<xsd:annotation>
			<xsd:documentation>Contains a reference to another rule (non-terminal) in the grammar.</xsd:documentation>
		</xsd:annotation>
		<xsd:attribute name="ref" type="stringType" use="required" />
	</xsd:complexType>
	
	<xsd:complexType name="propertyValueType">
		<xsd:annotation>
			<xsd:documentation>Contains key and value pairs for a properties to be written to the property bag. - O11</xsd:documentation>
		</xsd:annotation>
		<xsd:attribute ref="o:ls">
			<xsd:annotation>
				<xsd:documentation>The lifespan of the smart tag (use value "trans" for transitory and "temp" for temporary)</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute ref="o:exp">
			<xsd:annotation>
				<xsd:documentation>The expiration date/time of the smart tag (use the format "yyyy:MM:dd:hh:mm" for the value)</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:anyAttribute processContents="skip" />
	</xsd:complexType>
	
	<xsd:complexType name="termType" mixed="true">
		<xsd:annotation>
			<xsd:documentation>Contains the term to recognize, as well as an (optional) property to be written to the property bag. - O11</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="prop" minOccurs="0" type="propertyValueType">
				<xsd:annotation>
					<xsd:documentation>An element used to specify information to be written to the property bag on recognition of a smart tag. - O11</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="regularExpressionType" mixed="true">
		<xsd:annotation>
			<xsd:documentation>Contains the regular expression to recognize, as well as an (optional) property to be written to the property bag. - O11</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="prop" minOccurs="0" type="propertyValueType">
				<xsd:annotation>
					<xsd:documentation>An element used to specify information to be written to the property bag on recognition of a smart tag. - O11</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
		<xsd:attribute name="switches" type="stringType" use="optional">
			<xsd:annotation>
				<xsd:documentation>Determines whether the regular expression should be case-sensitive (the default) or case-insensitive (set to i).</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>
	
	<xsd:complexType name="mostlActionsType">
		<xsd:annotation>
			<xsd:documentation>Contains the actions associated with the current smart tag.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="action" maxOccurs="unbounded" type="actionType">
				<xsd:annotation>
					<xsd:documentation>The container for a single smart tag action.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="smartDocActionsType">
		<xsd:annotation>
			<xsd:documentation>Defines each of the Smart Document actions available for the current XML element.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="action" maxOccurs="unbounded" type="smartDocActionType">
				<xsd:annotation>
					<xsd:documentation>The container for a single smart document action.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="smartDocActionType">
		<xsd:annotation>
			<xsd:documentation>Defines each of the Smart Document actions used for the XML element.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="actionType" type="availableActionsType">
				<xsd:annotation>
					<xsd:documentation>The type of the current action.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="caption" minOccurs="0" type="stringType">
				<xsd:annotation>
					<xsd:documentation>The caption for the current smart document action.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="help" minOccurs="0" type="helpType">
				<xsd:annotation>
					<xsd:documentation>The location of an XHTML file with help content to be displayed (valid if actionType is HelpURL), or the XHTML itself (valid if actionType is Help).</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="imageURL" minOccurs="0" type="stringType">
				<xsd:annotation>
					<xsd:documentation>The location of an image to display under this control (valid if actionType is imageURL).</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:choice>
				<xsd:element name="url" minOccurs="0" type="stringType">
					<xsd:annotation>
						<xsd:documentation>A URL that will be launched when the user invokes this control. </xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="elementAction" minOccurs="0" type="elementActionType">
					<xsd:annotation>
						<xsd:documentation>An action which will be performed in the context of the current XML element in the document.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
			</xsd:choice>
		</xsd:sequence>
		<xsd:attribute name="id" use="required" type="stringType">
			<xsd:annotation>
				<xsd:documentation>A string uniquely idenitfying this action within the context of the current smart document.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>
	
	<xsd:simpleType name="availableActionsType">
		<xsd:annotation>
			<xsd:documentation>An enumeration of the available smart document actions available in the pane.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="stringType">
			<xsd:enumeration value="Link" />
			<xsd:enumeration value="Separator" />
			<xsd:enumeration value="Button" />
			<xsd:enumeration value="Label" />
			<xsd:enumeration value="Image" />
			<xsd:enumeration value="HelpURL" />
			<xsd:enumeration value="Help" />
			<xsd:enumeration value="DocumentFragmentURL"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:complexType name="helpType" mixed="true">
		<xsd:annotation>
			<xsd:documentation>A custom type which defines the XHTML content (which will not be explicitly validated) in the MOSTL file.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:any minOccurs="0" processContents="skip" />
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="arbitraryXMLType" mixed="true">
		<xsd:annotation>
			<xsd:documentation>A custom type which defines the insertable XML content (which will not be explicitly validated) in the MOSTL file.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:any minOccurs="0" processContents="skip" />
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:simpleType name="stringType">
		<xsd:annotation>
			<xsd:documentation>A custom type which defines all string elements in the MOSTL definition.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string" />
	</xsd:simpleType>
	
	<xsd:complexType name="actionType">
		<xsd:annotation>
			<xsd:documentation>Contains a single action to be associated with the current smart tag.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="caption" type="stringType">
				<xsd:annotation>
					<xsd:documentation>The UI caption which will be displayed on the smart tag menu for this action.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:choice>
				<xsd:element name="url" type="stringType">
					<xsd:annotation>
						<xsd:documentation>A URL which will be launched when the action is invoked. The {TEXT} qualifier allows you to pass the term into the URL.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="elementAction" type="elementActionType">
					<xsd:annotation>
						<xsd:documentation>An action which will be performed in the context of the current XML element in the document.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
			</xsd:choice>
		</xsd:sequence>
		<xsd:attribute name="id" use="required" type="stringType">
			<xsd:annotation>
				<xsd:documentation>A string uniquely idenitfying this action within the context of the current smart tag.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>
	
	<xsd:complexType name="elementActionType">
		<xsd:annotation>
			<xsd:documentation>Contains the actions possible on the current XML element.</xsd:documentation>
		</xsd:annotation>
		<xsd:choice>
			<xsd:element name="insertXML" type="arbitraryXMLType">
				<xsd:annotation>
					<xsd:documentation>Tells the action to insert XML content (as specified) into the current element (either XML in the file itself for smart tags, or the XML at the location specified for smart documents).</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="removeXML" type="stringType">
				<xsd:annotation>
					<xsd:documentation>Tells the action to remove all content from within the current XML node.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:choice>
	</xsd:complexType>
	
</xsd:schema>


почему _http://schemas.microsoft.com/office/smarttags/2003/mostl
а не urn:schemas-microsoft-com:smarttags:list тут
http://msdn.microsoft.com/en-us/library/office/aa195452(v=office.11).aspx The MOSTL namespace "urn:schemas-microsoft-com:smarttags:list" used in Office XP has now in Office 2003 became "_http://schemas.microsoft.com/office/smarttags/2003/mostl".
...
Рейтинг: 0 / 0
работа с xml
    #38396731
qwerty112
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
qwerty112вот схема, которую задаёт неймспейс
...
Рейтинг: 0 / 0
работа с xml
    #38396880
Фотография Antonariy
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Нда, тяжелый случай. Клинический прямо таки.

qwerty112определяетНет. Неймспейс может быть описан схемой, а может не быть . Постарайся вколотить себе это в голову, как бы трудно не было. И тогда для парсера он не значит ровным счетом ничего. А так же, если описан, но схема не предоставлена ни атрибутом schemaLocation ни программой, использующей парсер.

qwerty112так, а по каким правилам будет выполнятся эта валидация ?По тем, которые описаны в схеме. Если схема не предоставлена, то и валидация проходить не будет. xmlns="..." не является предоставлением схемы.

qwerty112xmlns - и задаёт эти правила !Нет. Правила задает схема, которая может быть вообще не связана ни с каким неймспейсом. Это в схеме указано, какой неймспейс определять, а не наоборот.

qwerty112 "верит нам на слово"Детский сад какой-то. Парсер ничего сам не делает. Если ему не сказано валидировать, то он документ проглотит, даже если схема предоставлена, а он ей не соответствует. И выдаст ошибку отсутствия схемы, если ее нет, но дана команда валидировать, а автор пребывает в твердой уверенности, что "неймспейс задает правила".

qwerty112а ты не понял моего комментария: "Задумывалось так", "идея была такая" - сделать что-то типа "библиотек типов"А мужики-то, которые задумали, не знают.
Я тебе дал ссылку на xsi:schemaLocation. Скажи, зачем нужно было выдумывать такой костыль, если бы реализация этого функционала была задумана в атрибуте xmlns?

qwerty112вот у меня непроходит впечатление, что ты считаешь эти неймспейсы какой-то "профанацией", которая не значит ровным счётом ничего ... - так это не такЭто ты считаешь, что я так считаю. Ты много чего считаешь, что не соответствует реальности.

Неймспейсы объединяют элементы в группы, каждая из которых может иметь правила, определяемые схемой, а может не иметь.

qwerty112вот схема, которую задаёт неймспейсНаоборот. Схема задает правила неймспейсу, а по значению xmlns происходит идентификация той группы тегов, которую нужно проверять на предмет соответствия правилам. Если схемы нет, то значение xmlns никого не колышет.

Короче, почитай что-нибудь умное вместо того, чтобы генерировать всякий несмешной бред.
...
Рейтинг: 0 / 0
13 сообщений из 38, страница 2 из 2
Форумы / Visual Basic [игнор отключен] [закрыт для гостей] / работа с xml
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]