Is there any use for XML tag name attribute?

hj2509
New Member

Hi I am new to apigee and xml in general.

Is there any use for XML tag name attributes? For example

<RouteRule name="NoRoute">
        <Condition>request.verb == "OPTIONS" AND request.header.origin != null AND request.header.Access-Control-Request-Method != null</Condition>
</RouteRule>

<Flow name="OptionsPreFlight">
            <Request/>
            <Response>
                <Step>
                    <Name>add-cors</Name>
                </Step>
            </Response>
            <Condition>request.verb == "OPTIONS" AND request.header.origin != null AND request.header.Access-Control-Request-Method != null</Condition>
</Flow>

I got this snippet of code from beginner tutorials. Does the RouteRule tag name have to be "NoRoute" and the name attribute of Flow have be "OptionsPreFlight"??

I tried changing them and it still seems to be working okay. What is the name attribute for?

Thank you

Solved Solved
0 1 144
1 ACCEPTED SOLUTION

@hyun jeon, the name attribute is just an identifier. You dont need to use the same name "NoRoute" or "OptionsPreflight". You could use any alphanumeric name, that's readable and upon looking at it you can identify what it is for.

FOr example: the name Noroute suggests there is no backend route; the flow name "GetEmployeeDetails" suggests its the operation for fetching Employee Details

View solution in original post

1 REPLY 1

@hyun jeon, the name attribute is just an identifier. You dont need to use the same name "NoRoute" or "OptionsPreflight". You could use any alphanumeric name, that's readable and upon looking at it you can identify what it is for.

FOr example: the name Noroute suggests there is no backend route; the flow name "GetEmployeeDetails" suggests its the operation for fetching Employee Details