Skip to main content

Home/ PSI_ESEI/ Contents contributed and discussions participated by David Gelpi Fleta

Contents contributed and discussions participated by David Gelpi Fleta

David Gelpi Fleta

Exercise 0 - 4 views

ejercicios
started by David Gelpi Fleta on 18 Oct 07 no follow-up yet
  • David Gelpi Fleta
     
    Hi people :)
    The first exercise of this course is about introduce yourselves.
    Write something about you (name, laboratory group, a greeting, whatever you want...)
    Don´t forget to choose an avatar.
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:minLength value="5"/> <xs:maxLength value="8"/>
  • <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:restriction base="xs:string"> <xs:pattern value="[a-z]"/>
  • 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 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 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 Complex Type - Empty Elements - 0 views

  • <xs:element name="product"> <xs:complexType> <xs:attribute name="prodid" type="xs:positiveInteger"/>
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 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.
  • 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
  • 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"
  • prefixed with xs:
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

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 CDATA - 0 views

  • Escape Characters Illegal XML characters have to be replaced by entity references. 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.
  • < < less than > > greater than & & ampersand  ' ' apostrophe " " quotation mark
  • Apostrophes, quotation marks and greater than signs are legal, but it is a good habit to replace them.
  • ...2 more annotations...
  • CDATA Everything inside a CDATA section is ignored by the parser.
  • A CDATA section starts with "<![CDATA[" and ends with "]]>":
David Gelpi Fleta

XML Namespaces - 0 views

  • XML Namespaces provide a method to avoid element name conflicts. Name Conflicts Since element names in XML are not predefined, a name conflict will occur when two different documents use the same element names.
  • <h:table>
  • <f:table>
  • ...8 more annotations...
  • <h:table xmlns:h="http://www.w3.org/TR/html4/">
  • <f:table xmlns:f="http://www.w3schools.com/furniture">
  • xmlns:namespace-prefix="namespaceURI"
  • Note that the address used to identify the namespace is not used by the parser to look up information. The only purpose is to give the namespace a unique name.
  • Uniform Resource Identifier (URI) A Uniform Resource Identifier (URI) is a string of characters which identifies an Internet Resource. The most common URI is the Uniform Resource Locator (URL) which identifies an Internet domain address.
  • not so common type of URI is the Universal Resource Name (URN)
  • Default Namespaces Defining a default namespace for an element saves us from using prefixes in all the child elements.
  • <table xmlns="http://www.w3.org/TR/html4/">
David Gelpi Fleta

XML Introduction - What is XML? - 0 views

  • What is XML? XML stands for EXtensible Markup Language XML is a markup language much like HTML XML was designed to describe data XML tags are not predefined. You must define your own tags XML uses a Document Type Definition (DTD) or an XML Schema to describe the data XML with a DTD or XML Schema is designed to be self-descriptive XML is a W3C Recommendation
  • The Extensible Markup Language (XML) became a W3C Recommendation 10. February 1998.
  • XML is not a replacement for HTML.
  • ...8 more annotations...
  • XML was designed to describe data and to focus on what data is. HTML was designed to display data and to focus on how data looks.
  • XML was created to structure, store and to send information.
  • It is just pure information wrapped in XML tags
  • XML tags are not predefined. You must "invent" your own tags. The tags used to mark up HTML documents and the structure of HTML documents are predefined.
  • XML allows the author to define his own tags and his own document structure.
  • XML will be used to describe the data, while HTML will be used to format and display the same data
  • XML is a cross-platform, software and hardware independent tool for transmitting information.
    • David Gelpi Fleta
       
      Cita un caso de uso de XML.
David Gelpi Fleta

Clase martes 9/10/07 - 15 views

ejercicios
started by David Gelpi Fleta on 03 Oct 07 no follow-up yet
  • David Gelpi Fleta
     
    Si eres alumno del grupo 2 (martes) y si es posible, échale un ojo a los bookmarks contenidos hasta el titulado "data islands" antes de la proxima sesión de laboratorio.
David Gelpi Fleta

Sobre la categoría "dudas teoría" - 3 views

dudas teoría
started by David Gelpi Fleta on 03 Oct 07 no follow-up yet
  • David Gelpi Fleta
     
    Escribe en esta categoría aquellas dudas que surjan en el desarrollo de las clases de laboratorio.
    La persona que conozca (o crea conocer) la respuesta, que pase a la acción ;)
David Gelpi Fleta

Sobre la categoría "ejercicios" - 11 views

ejercicios
started by David Gelpi Fleta on 03 Oct 07 no follow-up yet
  • David Gelpi Fleta
     
    En esta categoría, encontraremos los enunciados de los (pequeños) ejercicios a completar a lo largo del curso.
David Gelpi Fleta

Ejercicio 1 - 14 views

ejercicios
started by David Gelpi Fleta on 03 Oct 07 no follow-up yet
  • David Gelpi Fleta
     
    En el primero de los bookmarks ("Introduction to XML") responde a la pregunta de la nota, situada en el apartado "XML in Future Web Development".
    No repitas un caso de uso que ya haya sido citado; intenta aportar algún dato nuevo para incluir la mayor cantidad posible de información.
    Recuerda que el color verde del texto se reserva para el enunciado del ejercicio.
David Gelpi Fleta

XML Data Islands - 0 views

  • An XML data island is XML data embedded into an HTML page.
  • <html> <body> <xml id="note" src="http://www.w3schools.com/note.xml"></xml>
David Gelpi Fleta

XML DTD - 0 views

  • A "Well Formed" XML document has correct XML syntax. A "Well Formed" XML document is a document that conforms to the XML syntax rules that were described in the previous chapters: XML documents must have a root element XML elements must have a closing tag XML tags are case sensitive XML elements must be properly nested XML attribute values must always be quoted
  • A "Valid" XML document also conforms to a DTD. A "Valid" XML document is a "Well Formed" XML document, which also conforms to the rules of a Document Type Definition (DTD):
  • XML Schema is an XML based alternative to DTD.
David Gelpi Fleta

XML Attributes - 0 views

  • Attributes often provide information that is not a part of the data
  • <gangster name='George "Shotgun" Ziegler'>
  • <gangster name="George 'Shotgun' Ziegler">
  • ...3 more annotations...
  • Use of Elements vs. Attributes Data can be stored in child elements or in attributes.
  • Should you avoid using attributes? Some of the problems with using attributes are: attributes cannot contain multiple values (child elements can) attributes are not easily expandable (for future changes) attributes cannot describe structures (child elements can) attributes are more difficult to manipulate by program code attribute values are not easy to test against a Document Type Definition (DTD) - which is used to define the legal elements of an XML document
  • Try to use elements to describe data. Use attributes only to provide information that is not relevant to the data.
‹ Previous 21 - 40 of 43 Next ›
Showing 20 items per page