|
#1
|
|||
|
|||
|
Cross-Eyed XML
I've been throught this XML file way too many times now and cannot find the error in it. Everything seems okay, but AMS (5 & 6) give me errors when loading it for the actions.
If anyone has a moment to take a look, I'd appreciate the extra eyes Code:
<ActionTemplates>
<Action>
<Name>DateDiff.AddDays</Name>
<Description>Adds the specified number of days to the date.</Description>
<ReturnValueType>string</ReturnValueType>
<Arguments>
<Arg>
<Name>Date</Name>
<Description>The date to be added to.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/01/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
<Arg>
<Name>Days</Name>
<Description>The number of days to add.</Description>
<Type>number</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>10</Default>
<DataType>number</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
</Arguments>
</Action>
<Action>
<Name>DateDiff.AddMonths</Name>
<Description>Adds the specified number of months to the date.</Description>
<ReturnValueType>string</ReturnValueType>
<Arguments>
<Arg>
<Name>Date</Name>
<Description>The date to be added to.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/01/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
<Arg>
<Name>Months</Name>
<Description>The number of months to add.</Description>
<Type>number</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>10</Default>
<DataType>number</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
</Arguments>
</Action>
<Action>
<Name>DateDiff.AddYears</Name>
<Description>Adds the specified number of years to the date.</Description>
<ReturnValueType>string</ReturnValueType>
<Arguments>
<Arg>
<Name>Date</Name>
<Description>The date to be added to.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/01/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
<Arg>
<Name>Years</Name>
<Description>The number of years to add.</Description>
<Type>number</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>10</Default>
<DataType>number</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
</Arguments>
</Action>
<Action>
<Name>DateDiff.FormatSeconds</Name>
<Description>formats seconds into a string HH:MM:SS.</Description>
<ReturnValueType>number</ReturnValueType>
<Arguments>
<Arg>
<Name>Seconds</Name>
<Description>The number of seconds to format.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>3661</Default>
<DataType>number</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
</Arguments>
</Action>
<Action>
<Name>DateDiff.GetDayOfWeek</Name>
<Description>returns a numeric representation of the day of the week.</Description>
<ReturnValueType>number</ReturnValueType>
<Arguments>
<Arg>
<Name>Date</Name>
<Description>The date to return the day of the week for.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/01/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
</Arguments>
</Action>
<Action>
<Name>DateDiff.IsEqual</Name>
<Description>Compares Date1 with Date2</Description>
<ReturnValueType>boolean</ReturnValueType>
<Arguments>
<Arg>
<Name>Date1</Name>
<Description>first date in the expression.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/01/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
<Arg>
<Name>Date2</Name>
<Description>second date in the expression.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/25/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
</Arguments>
</Action>
<Action>
<Name>DateDiff.IsGreaterThan</Name>
<Description>Compares Date1 with Date2.</Description>
<ReturnValueType>boolean</ReturnValueType>
<Arguments>
<Arg>
<Name>Date1</Name>
<Description>first date in the expression.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/01/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
<Arg>
<Name>Date2</Name>
<Description>second date in the expression.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/25/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
</Arguments>
</Action>
<Action>
<Name>DateDiff.IsLessThan</Name>
<Description>Compares Date1 with Date2.</Description>
<ReturnValueType>boolean</ReturnValueType>
<Arguments>
<Arg>
<Name>Date1</Name>
<Description>first date in the expression.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/01/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
<Arg>
<Name>Date2</Name>
<Description>second date in the expression.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/25/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
</Arguments>
</Action>
<Action>
<Name>DateDiff.IsValid</Name>
<Description>check to see if the date is valid</Description>
<ReturnValueType>boolean</ReturnValueType>
<Arguments>
<Arg>
<Name>Date</Name>
<Description>the date to check for validity.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/01/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
</Arguments>
</Action>
<Action>
<Name>DateDiff.SubtractDays</Name>
<Description>Subtract the specified number of days from the date.</Description>
<ReturnValueType>string</ReturnValueType>
<Arguments>
<Arg>
<Name>Date</Name>
<Description>The date to be subracted from.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/01/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
<Arg>
<Name>Days</Name>
<Description>The number of days to subtract.</Description>
<Type>number</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>10</Default>
<DataType>number</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
</Arguments>
</Action>
<Action>
<Name>DateDiff.SubtractMonths</Name>
<Description>Subtracts the specified number of months from the date.</Description>
<ReturnValueType>string</ReturnValueType>
<Arguments>
<Arg>
<Name>Date</Name>
<Description>The date to be subtracted from.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/01/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
<Arg>
<Name>Months</Name>
<Description>The number of months to subtract.</Description>
<Type>number</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>10</Default>
<DataType>number</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
</Arguments>
</Action>
<Action>
<Name>DateDiff.SubtractYears</Name>
<Description>Subtracts the specified number of years from the date.</Description>
<ReturnValueType>string</ReturnValueType>
<Arguments>
<Arg>
<Name>Date</Name>
<Description>The date to be subtracted from.</Description>
<Type>string</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>"01/01/2005"</Default>
<DataType>string</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
<Arg>
<Name>Years</Name>
<Description>The number of years to subtract.</Description>
<Type>number</Type>
<Default/>
<Required>1</Required>
<EasyMode>
<Default>10</Default>
<DataType>number</DataType>
<Constraints>none</Constraints>
</EasyMode>
</Arg>
</Arguments>
</Action>
</ActionTemplates>
|
|
#2
|
||||
|
||||
|
Ran it through the validator: http://www.w3schools.com/dom/dom_validate.asp
and it said it was fine... I introduced a malformed tag and it caught it...so I assume the validator is working correctly... btw...the validator only works in IE |
|
#3
|
|||
|
|||
|
I tried that too with the same results, but once the file is compiled into my plugin, AMS doesn't like it. Also the error message indicates it's not getting the name of my plugin properly. But, like I said, if I take the last 2 actions out of my XML, everything loads and works fine.
All the actions still work, but the XML is hosed somewhere...
|
|
#4
|
|||
|
|||
|
Okay, I don't think it's the XML.
I droped the XML file into the Data\Actions folder and AMS reads it from there without any errors. So... the question is why does it error when reading it as a resource? |
|
#5
|
||||
|
||||
|
Worm,
I have run into this before. I bet it is the irPlg_GetPluginActionXML function in the DLL. For example, the Clipboard plugin's function looks like this: Code:
#define SIZE_XML_STRING 10000
char szXML[SIZE_XML_STRING];
// stuff...
int irPlg_GetPluginActionXML(char* szBuffer, int* pnBufferSize)
{
memset(szXML,0,10000);
if(!IR_PLUGIN_GetTextFromResourceFile("TEXTFILE",IDR_ACTIONSXML,szXML,SIZE_XML_STRING))
{
lstrcpy(szXML,"");
}
int nLength = lstrlen(szXML);
if(*pnBufferSize < nLength)
{
*pnBufferSize = nLength;
return -1;
} else
{
memset(szBuffer,0,*pnBufferSize);
lstrcpy(szBuffer,szXML);
return nLength;
}
}
#define SIZE_XML_STRING 10000 to: #define SIZE_XML_STRING 100000 (or whatever size you want) And then change: memset(szXML,0,10000); to be: memset(szXML,0,SIZE_XML_STRING); I am not sure of your code, but that is probably the problem. |
|
#6
|
|||
|
|||
|
That did it. Thanks Brett
You don't even want to know how much time I spent pouring over that XML file. Sheesh! |
|
#7
|
||||
|
||||
|
Been there. Done that. Bought the shirt.
|
|
#8
|
|||
|
|||
|
Is it a one size fits all? If so, can I borrow it
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| XML format | TJ_Tigger | AutoPlay Media Studio 5.0 | 6 | 10-04-2005 01:47 PM |
| Need help. How to add element to XML??? | dmla | AutoPlay Media Studio 5.0 | 5 | 11-10-2004 03:05 AM |
| XML plugin Project example - XML Weather from weather.com | kpsmith | AutoPlay Media Studio 5.0 | 8 | 06-03-2004 06:25 PM |
| Spotlight: XML Actions Plugin | Desmond | AutoPlay Media Studio 5.0 | 1 | 03-15-2004 04:56 PM |
| Using XML Or INI files during install | djpyne | Setup Factory 6.0 | 0 | 10-15-2003 11:55 AM |
All times are GMT -6. The time now is 08:12 PM.








Linear Mode

