Added new samples

This commit is contained in:
2023-06-19 11:24:11 +02:00
parent 843b710283
commit 3f392395e9
6 changed files with 120 additions and 126 deletions

View File

@@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<library>
<libraryName>City library</libraryName>
<libraryID>345123</libraryID>
<readerList>
<person>
<readerID>7321</readerID>
<name>Adam</name>
<surname>Choke</surname>
</person>
<person>
<readerID>5123</readerID>
<name>Lauren</name>
<surname>Wong</surname>
</person>
</readerList>
<bookList>
<book>
<bookID>6422</bookID>
<title>Harry Potter</title>
<readerID>7542</readerID>
</book>
<book>
<bookID>1234</bookID>
<title>Macbeth</title>
<readerID>5123</readerID>
</book>
<book>
<bookID>9556</bookID>
<title>Romeo and Juliet</title>
</book>
</bookList>
</library>

View File

@@ -1,7 +1,4 @@
declare namespace p="http://www.release11.com/person"; declare default element namespace "http://www.tibco.com/schemas/Shemy4tools/Folder/Schema.xsd";
declare namespace b="http://www.release11.com/book";
declare namespace l="http://www.release11.com/library";
for $x in /root/UserList[@Id = 'a']/User
for $x in //p:person return string($x/Name)
return string($x/p:name)

View File

@@ -1,33 +1,62 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version = "1.0" encoding = "UTF-8"?>
<l:library xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.release11.com" xmlns:l="http://www.release11.com/library" xmlns:p="http://www.release11.com/person" xmlns:b="http://www.release11.com/book"> <root xmlns = "http://www.tibco.com/schemas/Shemy4tools/Folder/Schema.xsd" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://www.tibco.com/schemas/Shemy4tools/Folder/Schema.xsd Schema4tools.xsd">
<l:libraryName>City library</l:libraryName> <UserList Id = "a">
<l:libraryID>345123</l:libraryID> <User Id = "1">
<l:readerList> <Name>John</Name>
<p:person> <Surname>Wick</Surname>
<p:readerID>7321</p:readerID> <DateOfDeath>2023-10-10</DateOfDeath>
<p:name>Adam</p:name> </User>
<p:surname>Choke</p:surname> <User Id = "2">
</p:person> <Name>Martha</Name>
<p:person> <Surname>Whane</Surname>
<p:readerID>5123</p:readerID> <DateOfDeath>1970-06-13</DateOfDeath>
<p:name>Lauren</p:name> </User>
<p:surname>Wong</p:surname> <User Id = "3">
</p:person> <Name>Bruce</Name>
</l:readerList> <Surname>Lee</Surname>
<l:bookList> <DateOfDeath>1985-01-24</DateOfDeath>
<b:book> </User>
<b:bookID>6422</b:bookID> <User Id = "4">
<b:title>Harry Potter</b:title> <Name>John</Name>
<p:readerID>7542</p:readerID> <Surname>Rambo</Surname>
</b:book> <DateOfDeath>2024-06-19</DateOfDeath>
<b:book> </User>
<b:bookID>1234</b:bookID> <NameList>FirstList</NameList>
<b:title>Macbeth</b:title> </UserList>
<p:readerID>5123</p:readerID> <UserList Id = "b">
</b:book> <User Id = "1">
<b:book> <Name>Jack</Name>
<b:bookID>9556</b:bookID> <Surname>Wicker</Surname>
<b:title>Romeo and Juliet</b:title> <DateOfDeath>2023-10-10</DateOfDeath>
</b:book> </User>
</l:bookList> <NameList>SecondList</NameList>
</l:library> </UserList>
<UserList Id = "c">
<User Id = "1">
<Name>New</Name>
<Surname>Folder</Surname>
<DateOfDeath>2023-11-10</DateOfDeath>
</User>
<User Id = "2">
<Name>Newer</Name>
<Surname>Folder</Surname>
<DateOfDeath>2023-11-11</DateOfDeath>
</User>
<User Id = "3">
<Name>Newest</Name>
<Surname>Folder</Surname>
<DateOfDeath>2023-11-12</DateOfDeath>
</User>
<User Id = "4">
<Name>New</Name>
<Surname>Folder2</Surname>
<DateOfDeath>2023-11-13</DateOfDeath>
</User>
<User Id = "5">
<Name>New</Name>
<Surname>Folder-Final</Surname>
<DateOfDeath>2023-11-14</DateOfDeath>
</User>
<NameList>ThirdList</NameList>
</UserList>
</root>

View File

@@ -1,42 +1,41 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace=""> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
<xsd:element name="library"> xmlns="http://www.tibco.com/schemas/Shemy4tools/Folder/Schema.xsd"
<xsd:complexType mixed="true"> targetNamespace="http://www.tibco.com/schemas/Shemy4tools/Folder/Schema.xsd"
<xsd:sequence> elementFormDefault="qualified"
<xsd:element minOccurs="0" name="libraryName" type="xsd:string" /> attributeFormDefault="unqualified">
<xsd:element minOccurs="0" name="libraryID" type="xsd:int" /> <xs:element name="root">
<xsd:element minOccurs="0" name="readerList"> <xs:complexType>
<xsd:complexType mixed="true"> <xs:sequence>
<xsd:sequence> <xs:element ref="UserList" maxOccurs="unbounded"/>
<xsd:element maxOccurs="unbounded" name="person"> </xs:sequence>
<xsd:complexType mixed="true"> </xs:complexType>
<xsd:sequence> </xs:element>
<xsd:element minOccurs="0" name="readerID" type="xsd:int" /> <xs:element name="UserList">
<xsd:element minOccurs="0" name="name" type="xsd:normalizedString" /> <xs:complexType mixed="true">
<xsd:element minOccurs="0" name="surname" type="xsd:normalizedString" /> <xs:sequence>
</xsd:sequence> <xs:element ref="User" maxOccurs="unbounded"/>
</xsd:complexType> <xs:element ref="NameList"/>
</xsd:element> </xs:sequence>
</xsd:sequence> <xs:attribute name="Id" type="xs:string" use="required"/>
</xsd:complexType> </xs:complexType>
</xsd:element> </xs:element>
<xsd:element minOccurs="0" name="bookList"> <xs:simpleType name="User">
<xsd:complexType mixed="true"> <xs:restriction base="xs:string"/>
<xsd:sequence> </xs:simpleType>
<xsd:element maxOccurs="unbounded" name="book"> <xs:element name="User">
<xsd:complexType mixed="true"> <xs:complexType>
<xsd:sequence> <xs:sequence>
<xsd:element minOccurs="0" name="bookID" type="xsd:int" /> <xs:element ref="Name"/>
<xsd:element minOccurs="0" name="title" type="xsd:string" /> <xs:element ref="Surname"/>
<xsd:element minOccurs="0" name="readerID" type="xsd:int" /> <xs:element ref="DateOfDeath"/>
</xsd:sequence> </xs:sequence>
</xsd:complexType> <xs:attribute name="Id" type="xs:int" use="required"/>
</xsd:element> </xs:complexType>
</xsd:sequence> </xs:element>
</xsd:complexType> <xs:element name="Name" type="xs:string"/>
</xsd:element> <xs:element name="Surname" type="xs:string"/>
</xsd:sequence> <xs:element name="DateOfDeath" type="xs:date"/>
</xsd:complexType> <xs:element name="NameList" type="xs:string"/>
</xsd:element> </xs:schema>
</xsd:schema>

View File

@@ -1,14 +1,16 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet version="1.0" xmlns:u = "http://www.tibco.com/schemas/Shemy4tools/Folder/Schema.xsd"
xmlns:b="http://www.release11.com/book" xmlns:p="http://www.release11.com/person" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
xmlns:l="http://www.release11.com/library">
<xsl:template match="/"> <xsl:template match="/">
<Library> <UserLists>
<ReaderCount> <UserListCount>
<xsl:value-of select="count(//p:person)" /> <xsl:value-of select="count(/u:root/u:UserList)" />
</ReaderCount> </UserListCount>
<BookCount> <xsl:for-each select="/u:root/u:UserList">
<xsl:value-of select="count(/l:library/l:bookList/b:book)" /> <UserListStats>
</BookCount> <Name><xsl:value-of select="u:NameList" /></Name>
</Library> <UserCount><xsl:value-of select="count(u:User)" /></UserCount>
</UserListStats>
</xsl:for-each>
</UserLists>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

View File

@@ -18,7 +18,7 @@ function setDefault() {
const emitName = "update:defaultData"; const emitName = "update:defaultData";
switch (props.prettyName.toLowerCase()) { switch (props.prettyName.toLowerCase()) {
case "xpath": case "xpath":
emit(emitName, "string(/l:library/l:libraryName)") emit(emitName, "/root/UserList/User[../NameList = 'FirstList']")
break; break;
case "xsd": case "xsd":
emit(emitName, sampleXSD) emit(emitName, sampleXSD)