Announcements
Hello,
I am trying to import using the following XML port:
xmlport 60100 MessageXMLPort
{
Format = Xml;
schema
{
textelement(Messages)
{
tableelement(Message; Message)
{
AutoUpdate = true;
fieldelement("ID"; Message.ID)
{
}
fieldelement("Sender"; Message.Sender)
{
MinOccurs = Zero;
}
fieldelement("Recipient"; Message.Recipient)
{
MinOccurs = Zero;
textattribute("Gender")
{
XmlName = 'gender';
Occurrence = Optional;
Unbound = true;
}
}
fieldelement("Subject"; Message.Subject)
{
MinOccurs = Zero;
}
fieldelement("Body"; Message.Body)
{
MinOccurs = Zero;
}
fieldelement("SentDate"; Message."Sent Date")
{
MinOccurs = Zero;
}
}
}
My file looks like this:
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<Messages>
<Message>
<ID>1</ID>
<Sender gender="male">John Doe</Sender>
<Recipient>jane.doe@example.com</Recipient>
<Subject>Welcome!</Subject>
<Body>Welcome to our platform.</Body>
<SentDate isPostponed="true">09/01/24</SentDate>
</Message>
<Message>
<ID>2</ID>
<Sender gender="male">Sales Team</Sender>
<Recipient>sales@company.com</Recipient>
<Subject>Weekly Update</Subject>
<Body>Please, find attached the weekly report.</Body>
<SentDate isPostponed="false">09/08/24</SentDate>
</Message>
<Message>
<ID>3</ID>
<Sender>HR Department</Sender>
<Recipient>hr@company.com</Recipient>
<Subject>New Policies Update</Subject>
<Body>We have updated the company's remote work policy.</Body>
<SentDate>09/10/24</SentDate>
</Message>
<Message>
<ID>4</ID>
<Sender>Support Team</Sender>
<Recipient>support@company.com</Recipient>
<Subject>Support Ticket #12345</Subject>
<Body>Your support ticket has been resolved.</Body>
<SentDate>09/12/24</SentDate>
</Message>
<Message>
<ID>5</ID>
<Sender>John T. Doe</Sender>
<Recipient>jane.doe@example.com</Recipient>
<Subject>Follow-Up</Subject>
<Body>Let me know if you have any further questions.</Body>
<SentDate>09/14/24</SentDate>
</Message>
</Messages>
I am receiving the error: "Imported XML cannot validate with the schema: The 'gender' attribute is not declared." What am I doing wrong with the attribute that it is not being recognized? (I know that I should also define the 'isPostponed' attribute, but I am trying to fix the gender one first).
Thank you in advance!
gender
attribute in your XML port for the Recipient field, but in the XML file, the gender
attribute is actually part of the Sender field, not the Recipient field.gender
attribute definition in the XML port to the Sender field, where it actually appears in the XML file.André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156