Skip to main content

Home/ PSI_ESEI/ Group items tagged XML

Rss Feed Group items tagged

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.
David Gelpi Fleta

XSLT <xsl:for-each> Element - 0 views

  • The &lt;xsl:for-each&gt; Element The XSL &lt;xsl:for-each&gt; element can be used to select every XML element of a specified node-set:
  • &lt;xsl:for-each select="catalog/cd"&gt;
  • We can also filter the output from the XML file by adding a criterion to the select attribute in the &lt;xsl:for-each&gt; element.
  • ...1 more annotation...
  • Legal filter operators are: =&nbsp; (equal) != (not equal) &amp;lt; less than &amp;gt; greater than
David Gelpi Fleta

XPath Syntax - 0 views

  • Selecting Nodes XPath uses path expressions to select nodes in an XML document.
  • Expression Description nodename Selects all child nodes of the named node / Selects from the root node // Selects nodes in the document from the current node that match the selection no matter where they are . Selects the current node .. Selects the parent of the current node @ Selects attributes
  • Selecting Several Paths By using the | operator in an XPath expression you can select several paths.
  • ...10 more annotations...
  • Wildcard Description * Matches any element node @* Matches any attribute node node() Matches any node of any kind
  • Predicates Predicates are used to find a specific node or a node that contains a specific value.
  • Predicates are always embedded in square brackets.
  • [last()]
  • [position()&lt;3]
  • title[@lang]
  • [@lang]
  • [@lang='eng']
  • [price&gt;35.00]
  • [1]
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!
  • &lt;xs:element name="employee"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt;
  • type="personinfo"/&gt; &lt;xs:complexType name="personinfo"&gt;
  • ...1 more annotation...
  • &lt;xs:complexType name="fullpersoninfo"&gt; &lt;xs:complexContent&gt; &lt;xs:extension base="personinfo"&gt;
David Gelpi Fleta

XSL - 24 views

Hemos marcado a través de la herramienta Diigo lo estrictamente necesario para añadir una capa de presentación a los datos etiquetados mediante XML. Encontraréis los apuntes en los "bookmarks" del ...

practica

started by David Gelpi Fleta on 27 Nov 07 no follow-up yet
David Gelpi Fleta

Exercise 1: note - 29 views

In the first of the bookmarks in the group PSI_ESEI ("Introduction to XML") answer to the question of the note, located under the title "XML in Future Web Development". Avoid repeat a use case cite...

ejercicios

started by David Gelpi Fleta on 18 Oct 07 no follow-up yet
David Gelpi Fleta

Ejercicio 1 - 14 views

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;...

ejercicios

started by David Gelpi Fleta on 03 Oct 07 no follow-up yet
David Gelpi Fleta

XML Schema Indicators - 0 views

  • Order indicators: All Choice Sequence Occurrence indicators: maxOccurs minOccurs Group indicators: Group name attributeGroup name
  • &lt;all&gt; indicator specifies that the child elements can appear in any order, and that each child element must occur only once
  • When using the &lt;all&gt; indicator you can set the &lt;minOccurs&gt; indicator to 0 or 1 and the &lt;maxOccurs&gt; 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...
  • &lt;choice&gt; indicator specifies that either one child element or another can occur
  • Occurrence indicators are used to define how often an element can occur.
  • The &lt;sequence&gt; indicator specifies that the child elements must appear in a specific order:
  • The &lt;maxOccurs&gt; indicator specifies the maximum number of times 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 &lt;minOccurs&gt; 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.
  • &lt;xs:group name="groupname"&gt;
  • After you have defined a group, you can reference it in another definition
  • &lt;xs:group name="persongroup"&gt;
  • &lt;xs:group ref="persongroup"/&gt;
  • &lt;xs:attributeGroup name="groupname"&gt;
  • &lt;xs:attributeGroup ref="personattrgroup"/&gt;
David Gelpi Fleta

XML Schema Complex Types - Mixed Content - 0 views

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

XML Schema Complex Type - Text Elements - 0 views

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

XML Schema Complex Type - Empty Elements - 0 views

  • &lt;xs:element name="product"&gt; &lt;xs:complexType&gt; &lt;xs:attribute name="prodid" type="xs:positiveInteger"/&gt;
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.
  • &lt;xs:attribute name="xxx" type="yyy"/&gt;
    • hocevik hocevik
       
      Simple Element tanımı aşağıdaki gibi :
    • hocevik hocevik
       
      Simple element tanımı :
      <xs:element name="lastname" type="xs:string"/>
  • 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: &lt;xs:attribute name="lang" type="xs:string" use="required"/&gt;
‹ Previous 21 - 32 of 32
Showing 20 items per page