?
Solved

WRITING XML CODE

Posted on 2008-11-09
18
Medium Priority
?
483 Views
Last Modified: 2013-11-19
I have been struggling to write xml code.

I have an available-flights DTD and some sample data, which I need to
use to create an XML document and then an XML schema
available-flights.dtd
---------------------------------------------------------------------------------------------------------
<!-- DTD for flight availability info -->
 
<!-- root definition for flight availability list -->
<!ELEMENT flight-availability-list (flight*)>
 
<!-- definitions for level 1 element -->
<!ELEMENT flight
   (origin, destination, carrier, departure-date-time, arrival-date-time, class+, (e-ticket)?) >
 
<!ATTLIST flight
  code	CDATA	#REQUIRED
  duration	CDATA 	#IMPLIED
  stops	CDATA	#IMPLIED
>  
  
<!-- level 2 elements -->
<!ELEMENT origin (#PCDATA)>
<!ELEMENT destination (#PCDATA)>
<!ELEMENT carrier (#PCDATA)>
<!ELEMENT departure-date-time (#PCDATA)>
<!ELEMENT arrival-date-time (#PCDATA)>
<!ELEMENT class (#PCDATA)>
<!ATTLIST class
  available-seats     CDATA	#IMPLIED>
 
<!ELEMENT e-ticket EMPTY>
---------------------------------------------------------------------------------------------------------------
Below is the sample data which needs to be used with the above DTD to create:
1. an XML document
2. XML Schema
 
SAMPLE DATA
 
  	Flight 1
Code	EJ286
Origin	London Gatwick
destination	Brussels
Carrier	EasyJet
departure-date-time	03/10/2008 0712
arrival-date-time	03/10/2008 0752
duration	0:40
available-seats	 
"         first	1
"         business	 
"         economy	26
 
  	Flight 2
Code	EJ288
Origin	London Gatwick
destination	Brussels
Carrier	EasyJet
departure-date-time	03/10/2008 0912
arrival-date-time	03/10/2008 0952
duration	0:40
available-seats	 
"         first	5
"         business	 
"         economy	27
 
  	Flight 3
Code	EJ286
Origin	London Gatwick
destination	Brussels
Carrier	EasyJet
departure-date-time	04/10/2008 0712
arrival-date-time	04/10/2008 0752
duration	0:40
available-seats	 
"         first	5
"         business	 
"         economy	27
 
any suggestions, thank you

Open in new window

0
Comment
Question by:ZARA01
  • 9
  • 9
18 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 2000 total points
ID: 22915785
Here is your schema
<?xml version="1.0" encoding="UTF-8"?>
<!-- DTD for flight availability info -->
<!-- root definition for flight availability list -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:element name="flight-availability-list">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="flight"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!-- definitions for level 1 element -->
  <xs:element name="flight">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="origin"/>
        <xs:element ref="destination"/>
        <xs:element ref="carrier"/>
        <xs:element ref="departure-date-time"/>
        <xs:element ref="arrival-date-time"/>
        <xs:element maxOccurs="unbounded" ref="class"/>
        <xs:element minOccurs="0" ref="e-ticket"/>
      </xs:sequence>
      <xs:attributeGroup ref="attlist.flight"/>
    </xs:complexType>
  </xs:element>
  <xs:attributeGroup name="attlist.flight">
    <xs:attribute name="code" use="required"/>
    <xs:attribute name="duration"/>
    <xs:attribute name="stops"/>
  </xs:attributeGroup>
  <!-- level 2 elements -->
  <xs:element name="origin" type="xs:string"/>
  <xs:element name="destination" type="xs:string"/>
  <xs:element name="carrier" type="xs:string"/>
  <xs:element name="departure-date-time" type="xs:string"/>
  <xs:element name="arrival-date-time" type="xs:string"/>
  <xs:element name="class">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="attlist.class"/>
    </xs:complexType>
  </xs:element>
  <xs:attributeGroup name="attlist.class">
    <xs:attribute name="available-seats"/>
  </xs:attributeGroup>
  <xs:element name="e-ticket">
    <xs:complexType/>
  </xs:element>
</xs:schema>

Open in new window

0
 
LVL 60

Assisted Solution

by:Geert Bormans
Geert Bormans earned 2000 total points
ID: 22915801
And here is an example XML (first dataset only)
now you can make the other two flight examples based on your data
<?xml version="1.0" encoding="UTF-8"?>
<flight-availability-list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="flight.xsd">
 
 <flight code="EJ286" duration="0:40">
  <origin>London Gatwick</origin>
  <destination>Brussels</destination>
  <carrier>EasyJet</carrier>
  <departure-date-time>03/10/2008 0712</departure-date-time>
  <arrival-date-time>03/10/2008 0752</arrival-date-time>
  <class available-seats="1">first</class>
  <class available-seats="">business</class>
  <class available-seats="26">economy</class>
 </flight>
 
</flight-availability-list>

Open in new window

0
 

Author Comment

by:ZARA01
ID: 22919014
Hi Gertone thank you so much for your response, much appreciated. However, I had trouble using:

<?xml version="1.0" encoding="UTF-8"?>
<flight-availability-list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="flight.xsd">

so I used:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE flight-availability-list SYSTEM "C:/available-flights.dtd">
<flight-availability-list>

Also another silly question, but the schema what extension file do I save it as?? flight-availability-list.xsd?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:ZARA01
ID: 22919081
sorry geert, ignore my previous comment the schema works perfectly, but how would i incoporate the following constraints:

departure-date-time should be of schema (xsd) type: dateTime
arrival-date-time should be of schema (xsd) type: dateTime
class should be one of: first, business, economy

(this last one I have managed to figure out, but not the other two)
any suggestions where in the schema it would be changed?

thank u
0
 
LVL 60

Assisted Solution

by:Geert Bormans
Geert Bormans earned 2000 total points
ID: 22919670
just change the type in the element definition
  <xs:element name="departure-date-time" type="xs:dateTime"/>
  <xs:element name="arrival-date-time" type="xs:dateTime"/>

note however that you need to change the content fields in the element into proper date Times
  <departure-date-time>2008-10-03T07:12:00</departure-date-time>
  <arrival-date-time>2008-10-03T07:52:00</arrival-date-time>
0
 

Author Comment

by:ZARA01
ID: 22922634
Gertone, thank you so much for that I even managed to get the xml schema to work with your previous code. You're such a great help :D

I have another question regarding one of my other other DTD's and XML schemas, please? I thought the code I had was ok, but it doens't seem to work. I noticed on one of your other answers to a similar question, you said to create a definition list, which lists the different enumerations.
How would I include the following constraints in my XML Schema for flight-request:

1.carrier should be one of: BA, BMI, EasyJet, RyanAir, Virgin (can't seem to figure this one out)
2.adult should be of schema (xsd) type: positive integer
3.children should be of schema (xsd) type: integer between 0 and 9

This is what I have got so far
This is my flight-request.xml
---------------------------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE flight-request SYSTEM "C:/flight-request.dtd">
<flight-request>
        <time-period>
                <start-date>03/10/2008</start-date>
                <end-date>05/10/2008</end-date>
        </time-period>
        <location>
                <origin>London Gatwick</origin>
                <destination>Brussels</destination>
        </location>
        <class-preference type="only">
                <class/>
        </class-preference>
        <class-preference type="preferred">
                <class>economy</class>
        </class-preference>
        <class-preference type="not">
                <class>business</class>
        </class-preference>
        <carrier-preference type="only">
                <carrier>BA</carrier>
        </carrier-preference>
        <carrier-preference type="preferred">
                <carrier/>
        </carrier-preference>
        <carrier-preference type="not">
                <carrier>virgin</carrier>
        </carrier-preference>
        <passengers>
                <adult>3</adult>
        </passengers>
</flight-request>
 
-------------------------------------------------------------------
flight-request DTD:
 
<!-- DTD for flight information request -->
 
<!-- root definition for flight request -->
<!ELEMENT flight-request (time-period, location, class-preference*, carrier-preference*, passengers)>
 
<!-- definitions for level 1 elements -->
<!ELEMENT time-period
   (start-date, end-date) >
 
<!ELEMENT location
   (origin, destination) >
 
<!ELEMENT class-preference
   (class+) >
<!ATTLIST class-preference
  type (only | preferred | not)  #REQUIRED>
 
<!ELEMENT carrier-preference
   (carrier+) >
<!ATTLIST carrier-preference
  type (only | preferred | not)  #REQUIRED>
 
<!ELEMENT passengers
   (adult, child?) >
 
<!-- level 2 elements -->
<!ELEMENT start-date (#PCDATA)>
<!ELEMENT end-date (#PCDATA)>
<!ELEMENT origin (#PCDATA)>
<!ELEMENT destination (#PCDATA)>
<!ELEMENT class (#PCDATA)>
<!ELEMENT carrier (#PCDATA)>
<!ELEMENT adult (#PCDATA)>
<!ELEMENT child (#PCDATA)>
 
 
----------------------------------------------------------------
 
 
for part 2 and 3 I got the XSD code:
 
<xs:element name="passengers">
	<xs:complexType>
	<xs:sequence>
	<xs:element ref="adult"/>
	<xs:element ref="child" minOccurs="0" maxOccurs="9"/>
	</xs:sequence>
	</xs:complexType>
	</xs:element>
	
         <xs:element name="start-date"/>
	<xs:element name="end-date"/>
	<xs:element name="origin"/>
	<xs:element name="destination"/>
	<xs:element name="class"/>
	<xs:element name="carrier"/>
	<xs:element name="adult" type="xs:positiveInteger"/>
	<xs:element name="child"/>
 
any suggestions for the above code and also the carrier constraint?? i'm struggling with xml schema. thank you

Open in new window

0
 
LVL 60

Assisted Solution

by:Geert Bormans
Geert Bormans earned 2000 total points
ID: 22923310
 <xs:element name="carrier">
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:enumeration value="BA"/>
        <xs:enumeration value="BMI"/>
        <xs:enumeration value="EasyJet"/>
        <xs:enumeration value="RyanAir"/>
        <xs:enumeration value="Virgin "/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

and

  <xs:element name="adult" type="xs:positiveInteger"/>
  <xs:element name="child">
    <xs:simpleType>
      <xs:restriction base="xs:integer">
        <xs:maxInclusive value="9"/>
        <xs:maxInclusive value="0"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
0
 

Author Comment

by:ZARA01
ID: 22923634
Thank you for the quick response,
Would I just plug that straight into my xsd file, overiding  the original  code for that particular element, before this constraint? Also where you have given the element name carrier, would I be safe to use carrier-preference or should it be left as carrier?

sorry lastly, where you have written

<xs:maxInclusive value="9"/>
<xs:maxInclusive value="0"/>

should the one with smaller value be minInclusive as opposed to maxInclusive?

thanks
0
 
LVL 60

Assisted Solution

by:Geert Bormans
Geert Bormans earned 2000 total points
ID: 22923706
yep, you can simply plug that in in your schema, overwriting th eother values

> should the one with smaller value be minInclusive as opposed to maxInclusive?

correct, sorry for the typo
0
 

Author Comment

by:ZARA01
ID: 22927429
Hi Gert,  thank you for that, it worked fine. Do you mind looking over my flight-request.xsd and see if I can make any adjustments to the coding. So far it validates ok and I have incorporated the constraints mentioned above.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="flight-request">
<xs:complexType>
 <xs:sequence>
              <xs:element ref="time-period"/>
              <xs:element ref="location"/>
              <xs:element ref="class-preference" minOccurs="0" maxOccurs="unbounded"/>
              <xs:element ref="carrier-preference" minOccurs="0" maxOccurs="unbounded"/>
              <xs:element ref="passengers"/>
 </xs:sequence>
</xs:complexType>
</xs:element>
 
<xs:element name="time-period">
<xs:complexType>
  <xs:sequence>
              <xs:element ref="start-date"/>
              <xs:element ref="end-date"/>
  </xs:sequence>
</xs:complexType>
</xs:element>
 
<xs:element name="location">
<xs:complexType>
  <xs:sequence>
              <xs:element ref="origin"/>
              <xs:element ref="destination"/>
  </xs:sequence>
</xs:complexType>
</xs:element>
 
<xs:element name="class-preference">
<xs:complexType>
 <xs:sequence>
              <xs:element ref="class" maxOccurs="unbounded"/>
 </xs:sequence>
   <xs:attribute name="type">
       <xs:simpleType>
            <xs:restriction base="xs:string">
                  <xs:enumeration value="only"/>
                  <xs:enumeration value="preferred"/>
                  <xs:enumeration value="not"/>
                  </xs:restriction>
       </xs:simpleType>
   </xs:attribute>
</xs:complexType>
        </xs:element>
 
<xs:element name="carrier-preference">
<xs:complexType>
 <xs:sequence>
              <xs:element ref="carrier" maxOccurs="unbounded"/>
 </xs:sequence>
  <xs:attribute name="type">
       <xs:simpleType>
           <xs:restriction base="xs:string">
                  <xs:enumeration value="BA"/>
                  <xs:enumeration value="BMI"/>
                  <xs:enumeration value="EasyJet"/>
                  <xs:enumeration value="RyanAir"/>
                  <xs:enumeration value="Virgin"/>
            </xs:restriction>
       </xs:simpleType>
  </xs:attribute>
</xs:complexType>
</xs:element>
 
<xs:element name="passengers">
<xs:complexType>
 <xs:sequence>
            <xs:element ref="adult"/>
            <xs:element ref="child" minOccurs="0" maxOccurs="9"/>
</xs:sequence>
</xs:complexType>
</xs:element>
 
        <xs:element name="start-date"/>
        <xs:element name="end-date"/>
        <xs:element name="origin"/>
        <xs:element name="destination"/>
        <xs:element name="class"/>
        <xs:element name="carrier"/>
        <xs:element name="adult" type="xs:positiveInteger"/>
        <xs:element name="child"/>
 
</xs:schema>

Open in new window

0
 

Author Comment

by:ZARA01
ID: 22927464
Hi Gert, sorry I just looked at my flight-availability-list xml schema (the very 1st one) and it doesn't seem to validate after I changed the constraints :(

The date constraints were fine, however I'm finding the class constraint tricky. I thought it would be the same as in the flight-request xml schema. Only this schema I have an attlist for class as well.. I think the error is occuring because an element has already been named "class" at the start and now half way down I'm trying to incorporate the constraint and name the element "class" again. It won't let me use ref or id either??

I looked at one of your other examples, where you incorporate both schemas into one, but is that the only way to get it to work? I only have the class constraint for this schema and not the flight-requests.xsd

here's what I have so far with the error
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2008 rel. 2 sp2 (http://www.altova.com) by zara (ahmed) -->
<!-- DTD for flight availability info -->
<!-- root definition for flight availability list -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:element name="flight-availability-list">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="flight" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<!-- definitions for level 1 element -->
	<xs:element name="flight">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="origin"/>
				<xs:element ref="destination"/>
				<xs:element ref="carrier"/>
				<xs:element ref="departure-date-time"/>
				<xs:element ref="arrival-date-time"/>
				<xs:element ref="class" maxOccurs="unbounded"/>
				<xs:element ref="e-ticket" minOccurs="0"/>
			</xs:sequence>
			<xs:attributeGroup ref="attlist.flight"/>
		</xs:complexType>
	</xs:element>
	<xs:attributeGroup name="attlist.flight">
		<xs:attribute name="code" use="required"/>
		<xs:attribute name="duration"/>
		<xs:attribute name="stops"/>
	</xs:attributeGroup>
	<!-- level 2 elements -->
	<xs:element name="origin" type="xs:string"/>
	<xs:element name="destination" type="xs:string"/>
	<xs:element name="carrier" type="xs:string"/>
	<xs:element name="departure-date-time" type="xs:dateTime"/>
	<xs:element name="arrival-date-time" type="xs:dateTime"/>
	
<!--the error is from here-->
 
	<xs:element name="class">
		<xs:simpleType>
			<xs:restriction base="xs:string">
				<xs:enumeration value="first"/>
				<xs:enumeration value="business"/>
				<xs:enumeration value="economy"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:element>
	
	
	<xs:element name="class">
		<xs:complexType mixed="true">
			<xs:attributeGroup ref="attlist.class"/>
		</xs:complexType>
	</xs:element>
	<xs:attributeGroup name="attlist.class">
		<xs:attribute name="available-seats"/>
	</xs:attributeGroup>
 
<!-- to here -->
 
	<xs:element name="e-ticket">
		<xs:complexType/>
	</xs:element>
</xs:schema>
 
 
any recommendations? thank u

Open in new window

0
 
LVL 60

Assisted Solution

by:Geert Bormans
Geert Bormans earned 2000 total points
ID: 22929624
about your flight-request.xsd, I am confused,
you now have
<xs:element ref="child" minOccurs="0" maxOccurs="9"/>
which means you can have up to 9 child elements,
which is not what you had in mind I think, so stick to my proposal if you need child to be optional and containing a number between 0 to 9. Th original DTD had one optional child element

As far as I can see that is about the only comment I have
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="flight-request">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="time-period"/>
                <xs:element ref="location"/>
                <xs:element ref="class-preference" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="carrier-preference" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="passengers"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    
    <xs:element name="time-period">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="start-date"/>
                <xs:element ref="end-date"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    
    <xs:element name="location">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="origin"/>
                <xs:element ref="destination"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    
    <xs:element name="class-preference">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="class" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="type">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="only"/>
                        <xs:enumeration value="preferred"/>
                        <xs:enumeration value="not"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    
    <xs:element name="carrier-preference">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="carrier" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="type">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="BA"/>
                        <xs:enumeration value="BMI"/>
                        <xs:enumeration value="EasyJet"/>
                        <xs:enumeration value="RyanAir"/>
                        <xs:enumeration value="Virgin"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    
    <xs:element name="passengers">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="adult"  minOccurs="0"/>
                <xs:element ref="child" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    
    <xs:element name="start-date"/>
    <xs:element name="end-date"/>
    <xs:element name="origin"/>
    <xs:element name="destination"/>
    <xs:element name="class"/>
    <xs:element name="carrier"/>
    <xs:element name="adult" type="xs:positiveInteger"/>
    <xs:element name="child">
        <xs:simpleType>
            <xs:restriction base="xs:integer">
                <xs:maxInclusive value="9"/>
                <xs:minInclusive value="0"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    
</xs:schema>

Open in new window

0
 
LVL 60

Assisted Solution

by:Geert Bormans
Geert Bormans earned 2000 total points
ID: 22929673
I am not to sure what you want to do in the other schema, but I think this is what you need
    <!--the error is from here-->
    
    <xs:element name="class">
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="myClassType">
                    <xs:attributeGroup ref="attlist.class"></xs:attributeGroup>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>
    
    <xs:simpleType name="myClassType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="first"/>
            <xs:enumeration value="business"/>
            <xs:enumeration value="economy"/>
        </xs:restriction>
    </xs:simpleType>
    
    <xs:attributeGroup name="attlist.class">
        <xs:attribute name="available-seats"/>
    </xs:attributeGroup>
    
    <!-- to here -->

Open in new window

0
 

Author Comment

by:ZARA01
ID: 22933910
Gert, thank you so much for your help - both XSD files work 100% now :)
0
 

Author Closing Comment

by:ZARA01
ID: 31514810
Gertone, can't thank you enough for your help with that xml coding. I hope to work with you again very soon - learnt a lot over the past few days thanks to you :)
Best of luck
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 22935176
welcome
0
 

Author Comment

by:ZARA01
ID: 22955060
Geert, I have another problem. I have added all text files for my xml and xsd coding in to a zip file. 3 files except the flight-availability-list.xml seem to validate.
This is how the document starts:
<?xml version="1.0" encoding="UTF-8"?>
<flight-availability-list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="flight-availability-list.xsd">

It says: "Unable to load a schema with target namespace " from 'flight-availability-list.xsd'.
    Error Location: flight-availability-list

Any idea why this might be? When the files are placed in normal unzipped folders, they validate, but why that particular one doesn't when zipped, confuses me :S sorry to be a pain
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 22959266
well, this can not work inside a zip package, unless...

xsi:noNamespaceSchemaLocation="flight-availability-list.xsd"
refers to the url of the schema
this url is a relative url, so each url-resolver will look in the same physical directory.

What could happen now is outside the schema validator.
The schema validator uses the URL-resolver of the language it is developed in, or used from.
If you are using xerces in Java, you could change the default behaviour of the Java URL-resolver to also look inside the same zip package

All of this is a bit tricky, I recommend that you unpack before validation, that would be a lot simpler then changing the URL resolver classes

cheers

Geert
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question