Skip to main content

Home/ Groups/ PSI_ESEI_08
David Gelpi Fleta

XPath Nodes - 0 views

  • In XPath, there are seven kinds of nodes: element, attribute, text, namespace, processing-instruction, comment, and document (root) nodes.
  • XML documents are treated as trees of nodes. The root of the tree is called the document node (or root node).
  • Atomic values Atomic values are nodes with no children or parent.
  • ...5 more annotations...
  • Children Element nodes may have zero, one or more children.
  • Relationship of Nodes Parent Each element and attribute has one parent.
  • Siblings Nodes that have the same parent.
  • Ancestors A node's parent, parent's parent, etc.
  • Descendants A node's children, children's children, etc.
David Gelpi Fleta

Problemas validación Redefine por Restricción - 58 views

Tod@s aquell@s que realiceis la práctica con Eclipse version 3.4.X debéis modificar la configuración del validador Schema (Xerces) para evitar que la redefinición por restricción no valide. Para el...

practica

started by David Gelpi Fleta on 09 Dec 08 no follow-up yet
David Gelpi Fleta

Práctica: tarea 3 - 101 views

En la sección "apuntes de prácticas" en Creaweb se encuentra el fichero Schema "tipos_web_plantilla.xsd" que contiene los tipos de datos que es necesario importar en la práctica. Más indicaciones e...

practica

started by David Gelpi Fleta on 18 Nov 08 no follow-up yet
David Gelpi Fleta

Práctica: tarea 2 (18/11/08) - 96 views

Esta semana hemos tratado el uso de los espacios de nombres, así como la sintaxis, normas y elementos básicos de Schema. Durante estas dos semanas (hasta el martes 18/11/08) intenteremos construir...

practica

started by David Gelpi Fleta on 04 Nov 08 no follow-up yet
David Gelpi Fleta

XML Schema Restrictions/Facets - 0 views

  • Restrictions are used to define acceptable values for XML elements or attributes. Restrictions on XML elements are called facets.
  • Restrictions on Values
  • <xs:restriction base="xs:integer"> <xs:minInclusive value="0"/> <xs:maxInclusive value="120"/> </xs:restriction>
  • ...15 more annotations...
  • Restrictions on a Set of Values To limit the content of an XML element to a set of acceptable values, we would use the enumeration constraint.
  • <xs:restriction base="xs:string"> <xs:enumeration value="Audi"/> <xs:enumeration value="Golf"/> <xs:enumeration value="BMW"/> </xs:restriction>
  • type="carType"/>
  • <xs:simpleType name="carType">
  • the type "carType" can be used by other elements
  • series of numbers or letters that can be used, we would use the pattern constraint.
  • <xs:restriction base="xs:string"> <xs:pattern value="[a-z]"/>
  • <xs:pattern value="male|female"/>
  • The whiteSpace constraint is set to "preserve", which means that the XML processor WILL NOT remove any white space characters:
  • <xs:whiteSpace value="preserve"/>
  • The whiteSpace constraint is set to "replace", which means that the XML processor WILL REPLACE all white space characters (line feeds, tabs, spaces, and carriage returns) with spaces:
  • <xs:whiteSpace value="replace"/>
  • <xs:length value="8"/>
  • <xs:minLength value="5"/> <xs:maxLength value="8"/>
  • Constraint Description enumeration Defines a list of acceptable values fractionDigits Specifies the maximum number of decimal places allowed. Must be equal to or greater than zero length Specifies the exact number of characters or list items allowed. Must be equal to or greater than zero maxExclusive Specifies the upper bounds for numeric values (the value must be less than this value) maxInclusive Specifies the upper bounds for numeric values (the value must be less than or equal to this value) maxLength Specifies the maximum number of characters or list items allowed. Must be equal to or greater than zero minExclusive Specifies the lower bounds for numeric values (the value must be greater than this value) minInclusive Specifies the lower bounds for numeric values (the value must be greater than or equal to this value) minLength Specifies the minimum number of characters or list items allowed. Must be equal to or greater than zero pattern Defines the exact sequence of characters that are acceptable totalDigits Specifies the exact number of digits allowed. Must be greater than zero whiteSpace Specifies how white space (line feeds, tabs, spaces, and carriage returns) is handled
David Gelpi Fleta

XML Schema Attributes - 0 views

  • Simple elements cannot have attributes. If an element has attributes, it is considered to be of a complex type. But the attribute itself is always declared as a simple type.
  • <xs:attribute name="xxx" type="yyy"/>
  • Attributes may have a default value OR a fixed value specified
  • ...1 more annotation...
  • Attributes are optional by default. To specify that the attribute is required, use the "use" attribute: <xs:attribute name="lang" type="xs:string" use="required"/>
David Gelpi Fleta

XML Schema Simple Elements - 0 views

  • What is a Simple Element? A simple element is an XML element that can contain only text. It cannot contain any other elements or attributes. However, the "only text" restriction is quite misleading. The text can be of many different types. It can be one of the types included in the XML Schema definition (boolean, string, date, etc.), or it can be a custom type that you can define yourself.
  • You can also add restrictions (facets) to a data type
  • you can require the data to match a specific pattern.
  • ...7 more annotations...
  • The syntax for defining a simple element is: <xs:element name="xxx" type="yyy"/>
  • built-in data types
  • xs:string xs:decimal xs:integer xs:boolean xs:date xs:time
    • David Gelpi Fleta
       
      Más tipos de datos predefinidos en: http://www.w3.org/TR/xmlschema-0/#simpleTypesTable
  • A default value is automatically assigned to the element when no other value is specified.
  • default="red"/
  • A fixed value is also automatically assigned to the element, and you cannot specify another value.
  • fixed="red"/
David Gelpi Fleta

Introduction to XML Schemas - 0 views

  • XML Schema is an XML-based alternative to DTD. An XML schema describes the structure of an XML document. The XML Schema language is also referred to as XML Schema Definition (XSD).
  • An XML Schema: defines elements that can appear in a document defines attributes that can appear in a document defines which elements are child elements defines the order of child elements defines the number of child elements defines whether an element is empty or can include text defines data types for elements and attributes defines default and fixed values for elements and attributes
  • XML Schemas are extensible to future additions XML Schemas are richer and more powerful than DTDs XML Schemas are written in XML XML Schemas support data types XML Schemas support namespaces
  • ...1 more annotation...
  • XML Schema became a W3C Recommendation 02. May 2001.
David Gelpi Fleta

XML schema Element - 0 views

  • The <schema> element is the root element of every XML Schema:
  • The <schema> element may contain some attributes. A schema declaration
  • <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3schools.com" xmlns="http://www.w3schools.com" elementFormDefault="qualified">
  • ...7 more annotations...
  • targetNamespace="http://www.w3schools.com" indicates that the elements defined by this schema (note, to, from, heading, body.) come from the "http://www.w3schools.com" namespace.
  • xmlns:xs="http://www.w3.org/2001/XMLSchema" indicates that the elements and data types used in the schema come from the "http://www.w3.org/2001/XMLSchema" namespace.
  • prefixed with xs:
  • xmlns="http://www.w3schools.com" indicates that the default namespace is "http://www.w3schools.com".
  • Referencing a Schema in an XML Document
  • xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3schools.com note.xsd"
  • This attribute has two values. The first value is the namespace to use. The second value is the location of the XML schema to use for that namespace
David Gelpi Fleta

Why Use XML Schemas? - 0 views

  • XML Schemas Support Data Types
  • It is easier to describe allowable document content It is easier to validate the correctness of data It is easier to work with data from a database It is easier to define data facets (restrictions on data) It is easier to define data patterns (data formats) It is easier to convert data between different data types
  • XML Schemas use XML Syntax
  • ...4 more annotations...
  • You don't have to learn a new language You can use your XML editor to edit your Schema files You can use your XML parser to parse your Schema files You can manipulate your Schema with the XML DOM You can transform your Schema with XSLT
  • XML Schemas are Extensible
  • Reuse your Schema in other Schemas Create your own data types derived from the standard types Reference multiple schemas in the same document
  • Well-Formed is not Enough
David Gelpi Fleta

XML Schema Complex Elements - 0 views

  • A complex element is an XML element that contains other elements and/or attributes. There are four kinds of complex elements: empty elements elements that contain only other elements elements that contain only text elements that contain both other elements and text Note: Each of these elements may contain attributes as well!
  • <xs:element name="employee"> <xs:complexType> <xs:sequence>
  • type="personinfo"/> <xs:complexType name="personinfo">
  • ...1 more annotation...
  • <xs:complexType name="fullpersoninfo"> <xs:complexContent> <xs:extension base="personinfo">
David Gelpi Fleta

XML Schema How To - 0 views

  • This XML document has a reference to an XML Schema:
  • xsi:schemaLocation="http://www.w3schools.com note.xsd"
David Gelpi Fleta

XML Schema Complex Types - Mixed Content - 0 views

  • A mixed complex type element can contain attributes, elements, and text.
  • mixed="true">
David Gelpi Fleta

XML Schema Complex Type - Text Elements - 0 views

  • This type contains only simple content (text and attributes),
  • <xs:element name="shoesize"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:integer"> <xs:attribute name="country" type="xs:string" />
David Gelpi Fleta

XML Schema Indicators - 0 views

  • Order indicators: All Choice Sequence Occurrence indicators: maxOccurs minOccurs Group indicators: Group name attributeGroup name
  • <all> indicator specifies that the child elements can appear in any order, and that each child element must occur only once
  • When using the <all> indicator you can set the <minOccurs> indicator to 0 or 1 and the <maxOccurs> indicator can only be set to 1
    • David Gelpi Fleta
       
      The all group is limited to the top-level of any content model. Es ilegal!! : ...... ....
  • ...14 more annotations...
  • <choice> indicator specifies that either one child element or another can occur
  • The <sequence> indicator specifies that the child elements must appear in a specific order:
  • Occurrence indicators are used to define how often an element can occur.
  • For all "Order" and "Group" indicators (any, all, choice, sequence, group name, and group reference) the default value for maxOccurs and minOccurs is 1.
  • The <maxOccurs> indicator specifies the maximum number of times an element can occur:
  • The <minOccurs> indicator specifies the minimum number of times an element can occur:
  • To allow an element to appear an unlimited number of times, use the maxOccurs="unbounded" statement:
    • David Gelpi Fleta
       
      Ver algunos ejemplos sobre indicadores de ocurrencia: http://www.w3.org/TR/xmlschema-0/#cardinalityTable
  • Group indicators are used to define related sets of elements.
  • <xs:group name="groupname">
  • After you have defined a group, you can reference it in another definition
  • <xs:group name="persongroup">
  • <xs:group ref="persongroup"/>
  • <xs:attributeGroup name="groupname">
  • <xs:attributeGroup ref="personattrgroup"/>
David Gelpi Fleta

XML Schema Complex Type - Empty Elements - 0 views

  • <xs:element name="product"> <xs:complexType> <xs:attribute name="prodid" type="xs:positiveInteger"/>
David Gelpi Fleta

Comienzo de la práctica. - 129 views

El martes día 28/10/08 dió comienzo la práctica de este año. Expusimos los objetivos a alcanzar de aquí al 15 de Diciembre. El primero de ellos consiste en proteger la inversión en sistemas de info...

practica

started by David Gelpi Fleta on 03 Nov 08 no follow-up yet
David Gelpi Fleta

XML Usage - 1 views

  • With XML, data can be stored in separate XML files. This way you can concentrate on using HTML for layout and display,
  • XML Simplifies Data Sharing
  • databases contain data in incompatible formats.
  • ...10 more annotations...
  • XML data is stored in plain text format. This provides a software- and hardware-independent way of storing data.
  • XML Simplifies Data Transport
  • With XML, data can easily be exchanged between incompatible systems.
  • Since XML data is stored in plain text format, XML provides a software- and hardware-independent way of sharing data.
  • XML Simplifies Platform Changes
  • Large amounts of data must be converted and incompatible data is often lost.
  • XML Makes Your Data More Available
  • With XML, your data can be available to all kinds of "reading machines"
  • XML is Used to Create New Internet Languages
  • XHTML the latest version of HTML  WSDL for describing available web services WAP and WML as markup languages for handheld devices RSS languages for news feeds RDF and OWL for describing resources and ontology SMIL for describing multimedia for the web 
David Gelpi Fleta

XML Syntax - 0 views

  • All XML Elements Must Have a Closing Tag
  • XML Tags are Case Sensitive
  • XML Elements Must be Properly Nested
  • ...10 more annotations...
  • <note date="12/11/2007">
  • Entity References
  • XML Documents Must Have a Root Element
  • If you place a character like "<" inside an XML element, it will generate an error because the parser interprets it as the start of a new element.
  • (child elements
  • < < less than > > greater than & & ampersand  ' ' apostrophe " " quotation mark
  • XML Attribute Values Must be Quoted
  • With XML, White Space is Preserved
  • Comments in XML
  • <!-- This is a comment -->
David Gelpi Fleta

XML Elements - 0 views

  • What is an XML Element? An XML element is everything from (including) the element's start tag to (including) the element's end tag. An element can contain other elements, simple text or a mixture of both. Elements can also have attributes.
  • XML documents can be extended to carry more information.
  • XML Naming Rules
  • ...11 more annotations...
  • no words are reserved.
  • Best Naming Practices
  • Make names descriptive
  • Names should be short and simple
  • Avoid "-"
  • Avoid "."
  • Avoid ":"
  • use the naming rules of your database for the elements in the XML documents.
  • Non-English letters
  • XML elements must follow these naming rules: Names can contain letters, numbers, and other characters Names must not start with a number or punctuation character Names must not start with the letters xml (or XML, or Xml, etc) Names cannot contain spaces
  • make names descriptive.
‹ Previous 21 - 40 of 49 Next ›
Showing 20 items per page